Friday, August 1, 2008

Tracking User's activity using "script -a"

Unix System provides a very good method allows us to capture of all commands issued by the user “XYZ”. For this, we can user "script" command. This will print all what appears on the screen (commands and their output) to the filename

But remember, Its not a User History.... It stores all commands entered by all users (.e. its the shell history .

Add the following line to your BASH profile

script -a ~/.termlog`date +%m%d%y`

This enable to capture all the terminal activities to a file ending with current date