How can I log user activity on SSH [duplicate]
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.