Shell script for to view all users & groups history in root


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script for to view all users & groups history in root
# 1  
Old 07-29-2011
Shell script for to view all users & groups history in root

Dear All,

I want to know all users & group history in one file, for root[administrator] terminal through shell or any other option
# 2  
Old 07-29-2011
"All history" is a lot of data, which is not all captured. Do you want login, process starts, ???
# 3  
Old 08-01-2011
Hi DGPickett,

I created one group.Group name Group1.Under group have 10 user.what is my think is i want know all 10 user history.Its possible to view particular user like /home/user1/.bash_history.But this is a big process.so i want all user history in one file through shell or any other option.please reply that if you know
# 4  
Old 08-01-2011
Well, the bash history is what they typed into the shell, which may run many things.

I suppose you could hack an open source shell to syslog() every line they type into it. That does not help if they use a different shell. Similarly, you could modify the UNIX Kernel so it syslog()'d every exec*() call. If you turn on accounting, you may get such a report logged.

Generally, if you don't want people to run stuff, you give them a restricted shell or no login at all, just services or web pages!
# 5  
Old 08-02-2011
"user" with ALL permission BUT should not deleting history file.

Thanks DGPickett,

What i need is :
Code:
1. "root" should be accessed by only one person. [Now it is not like that:)]
2. "user" should have rwx access to any directory , which is permitted by "root"
3. The "root" need to get history used by "user"
4. And at last , "user" should not delete his own history at any cost..!!

The thing is , "root" want to track out all the commands running by "user".
# 6  
Old 08-02-2011
Well, the user is writing shell history, but it wraps, and the user can destroy it, since they can write it. That is why I mentioned a syslog(), which sends off a message not recallable. I change my HISTFILE and HISTSIZE for more recall not deleted, and back up HISTFILE so I can recall more. But it is almost impossible to track a UNIX user's every execution unless you truss/tusc/strace init or the like. You might do it with a modified /lib/libc.so, if everyone uses the dynamic link. You are really talking about proprietary features added to UNIX. Even then, one might download static binaries and run them.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

On korn shell, how to share history between regular user and root?

I'm exploring OpenBSD and want to stick to its default shell, which is ksh. My goal is for my regular user ("bruno") and root user to have a shared history file. However, it seems that when running as root, ksh refuses to write to a HISTFILE that is owned by non-root user. This illustrates the... (3 Replies)
Discussion started by: DevuanFan
3 Replies

2. UNIX for Beginners Questions & Answers

How to write a UNIX script to send a mail to the respective individual users about their groups?

Hi Team, I got a requirement to send a mail to the individual users of a unix server about their respective groups. can some one help me to provide the script as I am unable to write that. I tried with below lines but I come out with errors. cat /etc/passwd | awk -F':' '{ print $1}' |... (6 Replies)
Discussion started by: harshabag
6 Replies

3. Shell Programming and Scripting

Script to read through a file and create new users/assign them to groups in Ubuntu

Hi all. I need a shell script that can, in short, read through a text file line by line and create a new user in Ubuntu, as well as assign that user to a group. The format of the text file is not important but preferably: 'username:group'. I don't have much programming knowledge no matter shell... (3 Replies)
Discussion started by: LewisWeekly
3 Replies

4. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

5. Shell Programming and Scripting

Shell Script to zip users cmd history log files

I admit I am terrible with scripting, so when I was asked to store users' command history lines and zip them on monthly basis what I did was to create a file "user_history_Feb" with the following contents: Part A # more user_history_Feb cp -p /var/log/user_history/*history... (6 Replies)
Discussion started by: hedkandi
6 Replies

6. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

7. Shell Programming and Scripting

Addsudoers: A script to add users or groups into /etc/sudoers

Well, sudo is a great tool for delegating permissions among admins. But, it's really hard to find a great tool which would give an interactive way of editing /etc/sudoers file. Now, when I say "editing", I really refer to add new groups, users, aliases in the /etc/sudoers file. visudo is great... (2 Replies)
Discussion started by: admin_xor
2 Replies

8. Shell Programming and Scripting

shell script to find unowned users and groups

Hello, I am new to Unix and shell scripting. I am trying to find unowned files and groups on my servers. I know, i could use the below command to find it on individual server. #find / -nouser -o -nogroup -print But I was wondering, if someone could help with a shell script so that I can... (2 Replies)
Discussion started by: ut916
2 Replies

9. UNIX for Advanced & Expert Users

View process history

Hi, Is there any way to view process history. Suppose I had killed a few procs yesterday and now I want to see what were the procs that were running yesterday? (2 Replies)
Discussion started by: King Nothing
2 Replies

10. Shell Programming and Scripting

Extract directories, users, groups & permissions to excel

Hi As the title descibes I wish to create an excel spreadsheet which lists all directories in full allong with the users, groups and rights. I have not used Perl scripts before so I'm a little lost on this on. Cheers (0 Replies)
Discussion started by: MacLon
0 Replies
Login or Register to Ask a Question