Visit Our UNIX and Linux User Community

keep track of every user

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting keep track of every user
# 1  
Old 09-18-2008
Data keep track of every user

dear all ,

I m new to shell programming and I need your help.

Actually i want to keep track of all the commands executed in a bash prompt of users ,
very much in same manner as it is displayed when we run "history" command.

now the users are smart enough as they delete their history by "history -c".

I have read about auditing in linux but logs are very confusing and not very much in detailed for what was the argument that was passed with the command .

Can anyone give me an idea of how to get the complete command history or how could i disable "history -c" so that i can keep track of the records of the users.

my motive is to get the command exactly in same manner as it was executed

E.g: -- Someone typed "rm -rf Impfile.txt"

Then i need exactly the same syntax ----> "rm -rf Impfile.txt" to keep the track record .

I have searched several forums all say that it is not possible to stop users from deleting their history .
I have googled a lot for this but didn't find any satisfactory answer.

I know there must be some solution to this that is why I am posting in this forum as many linux experts are on this forum.

Thanx in Advance

# 2  
Old 09-18-2008
You could look into rootsh
# 3  
Old 09-18-2008
thanx for the reply

Could you please explain in little detail.
# 4  
Old 09-18-2008
From the link: rootsh
Rootsh is a wrapper for shells which logs all echoed keystrokes and terminal output to a file and/or to syslog. It's main purpose is the auditing of users who need a shell with root privileges. They start rootsh through the sudo mechanism.
This may not suit your requirement, but it's out there, and you can look at it...
# 5  
Old 09-18-2008
Will it work for those users who don't need a shell with root privileges. I mean only the normal user.
As my motive is to keep track of the normal users activity.
# 6  
Old 09-18-2008
I have not tried to implement it for any user aside from those requiring root permissions.

From the description, it seems that it could be modified for any user:
wrapper for shells which logs all echoed keystrokes and terminal output to a file and/or to syslog
# 7  
Old 09-18-2008
I m sorry to say but that doen't help me much.

I have read for rootsh it is designed for the root shell recording. but my motive is to keep track of ordinary users!!!!!!!!!

Please help

Previous Thread | Next Thread
Test Your Knowledge in Computers #794
Difficulty: Medium
1/10 has a finite binary representation.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Track activity of a user

Hi All We have a job which writes files to a server at a particular time. The files will be created by a particular user ID Today, during the execution of the job, it created a file to the server and the file sat on the server for sometime, but was deleted immediately at the end of the... (4 Replies)
Discussion started by: sparks
4 Replies

2. UNIX for Dummies Questions & Answers

How to track user activity?

Hi All Please can you help me with the following issue: A certain vendor installed an application in which for a user to log in; the user must use a user created/predefined by the application. And because this application has more than one user its difficult to track who did what and when,... (6 Replies)
Discussion started by: fretagi
6 Replies

3. Homework & Coursework Questions

Track user log!

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The task is to measure the density of users that are logged on system. The program should check that every 30... (7 Replies)
Discussion started by: petel1
7 Replies

4. UNIX for Dummies Questions & Answers

Track user

Hi, i suddenly realized that a directory is deleted unfortunately there are many user have pervilages on this directory is there a way to track the user who delete this directory or atleast from now can i enable something so that i can track from now I think there is way from... (2 Replies)
Discussion started by: crackgeek
2 Replies

5. AIX

Track deleted OS user accounts

Recently we've had a couple user accounts mysteriously disappear. Is there any way to track these accounts and determine who/how they were deleted? (2 Replies)
Discussion started by: Sk0glund
2 Replies

6. UNIX for Advanced & Expert Users

Track user commands

Hi, I have a unix server and I am concerned about the security on that server. I would like to be able to write a script that records all the commands that were typed at the command prompt before the user calls the 'history -c' command and deletes all the history. I was thinking about firing or... (7 Replies)
Discussion started by: mishkamima
7 Replies

7. AIX

Track user logoff in AIX 5.3

Hi Does anybody know if there is a way in AIX 5.3 to track how a user was logged off? For instance where the user typed exit, hit crtl D, shell process was killed, etc. I know of the last log entries but this just shows a users login time and duration. I also tried syslog but I only get login... (5 Replies)
Discussion started by: kimyo
5 Replies

8. UNIX for Dummies Questions & Answers

Possible to track FTP user last login? Last and Finger don't track them.

Like the topic says, does anyone know if it is possible to check to see when an FTP only user has logged in? Because the shell is /bin/false and they are only using FTP to access the system doing a "finger" or "last" it says they have never logged in. Is there a way to see when ftp users log in... (1 Reply)
Discussion started by: LordJezo
1 Replies

9. UNIX for Advanced & Expert Users

Track user activity --pls help

hi I want to know how to save all the command used by all the used under a particular root with the time stamp in a file. Eg: User Name: UX10 Time: 10:56 Command: LS User Name: UX23 Time: 10:59 Command: MORE abc.txt -Anand (2 Replies)
Discussion started by: anandtharani
2 Replies

10. Programming

keep track of the last 10 commands the user typed

Can I do it like this? if (strcmp(argv, "history")==0) { argv = "10"; execvp(argc,argv); } actually, it doesn't work, How can I modify it? Thanks (17 Replies)
Discussion started by: zhshqzyc
17 Replies

Featured Tech Videos