Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Possible Duplicate:
How to log every linux command to a logserver

I want to log the commands executed by all users on the server. Is there any better way than using script command?

share|improve this question

marked as duplicate by quanta, EEAA, ewwhite, mattdm, Iain Sep 7 '12 at 6:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Why are you looking to record all commands? –  ewwhite Sep 6 '12 at 23:46

2 Answers 2

A possible application to do this is rootsh. see: http://sourceforge.net/projects/rootsh/

Be careful though, you will be capturing all sorts of passwords, confidential data and other things that need to be stored in the highest security you have available. Think of what could happen if this information was captured. Also, depending on the number of users on your system there could be a lot of data.

share|improve this answer

That should be contained under history for each of the users or under /home/$username/.bash_history where $username is the name of the actual user, of course if the user home directory is not under home that it will be like /path/to/homedir/.bash_history

share|improve this answer
1  
history -c ; export HISTFILE=/dev/null; do stuff; exit. The information only gets written to $HISTFILE when the user exits cleanly. –  Iain Sep 6 '12 at 10:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.