Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 was marked as an exact duplicate of an existing question.

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

A possible application to do this is rootsh. see:

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
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.