I need to log as much as possible when users a doing su *
...
Best would be to log all commands especially for the case root
does something as a user. We can assume root
would not change this logging behaviour.
I think the matching deal would be something like SULOG in debian.
How can I get that running?
Add a comment
|
1 Answer
pam_tty_audit(8)
was written for exactly this problem:
Examples
Audit all administrative actions.
session required pam_tty_audit.so disable=* enable=root
You could place this is /etc/pam.d/sudo
for auditing only sudo(8)
, or in /etc/pam.d/common-session
if you wanted to audit everything root
does at any console.
-
Thanks, sounds fine. I used the
common-session
way. But - where goes the logging to? And - when beeing root it resulted in two entries in/var/log/messages
:changed status from 0 to 1
immediately followed byrestored status to 0
. Any more hints? Commented Jul 11, 2011 at 8:34 -
1@Bastian, no idea on the
/var/log/messages
entries. The logging will go to your/var/log/audit/audit.log
file -- perhapsausearch(1)
can make the logs easier to search or read.– sarnoldCommented Jul 11, 2011 at 21:45