Possible Duplicate:
How do I log every command executed by a user?
How can I log SSH activity on 10.04 Ubuntu Server? This includes all commands he issued and output he got.
Possible Duplicate:
How do I log every command executed by a user?
How can I log SSH activity on 10.04 Ubuntu Server? This includes all commands he issued and output he got.
2 options I see for you:
Use 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 wil not log everything, only what they perform in a root shell.
Use screen. You can force users in a screen-session when they log on to your server, you can then use screen to log everything they type.
But the bottom-line is, if you don't trust a user, don't allow them on your system. No system is bulletproof.
rootsh is not a good option since they may or may not do actions with root privileges, but I need to know about all actions. For the screen I am not sure how to force and will they be aware easily that they are in screen? If you could give some hints on how to force ssh login to enter screen, then I might try experience. Actually it's not about breaking something on my system, just monitoring the job is done properly or not. It's not a security issue, just supervising.
– Michael
Feb 22 '12 at 08:09
Possible screen as shell?
But its hard for be sure, that user cant hack that.
Add:
LogLevel Debug3
to /etc/ssh/sshd_config and restart.
Note: "Logging with a DEBUG level violates the privacy of users and is not recommended."
debug3: Wrote 52 byte for a total of 3931. This is not what I want. Something human readable.
– Michael
Feb 22 '12 at 07:52
http://serverfault.com/questions/140347/record-everything-on-command-line-centos-fedora-ubuntu
– neolix Feb 22 '12 at 07:03