Using Sudo
By Tony Lawrence2005-05-12
Logging
Defaults logfile=/var/log/sudologNotice that this time there is no ":". This default therefor applies to everyone.
With this in place, all sudo commands will be logged:
# /var/log/sudologThere's a limitation though:
Feb 24 06:56:59 : jim : TTY=tty4 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/cat /etc/shadow
Feb 24 06:58:49 : jim : TTY=tty4 ; PWD=/var/log ; USER=root ; COMMAND=/bin/cat /etc/shadow
[jim@lnxserve jim]$ sudo cat /etc/shadow > /tmp/shadowThe redirection to /tmp/shadow does not show up in the log. That makes perfect sense: redirection is done by the shell before the commands are run, so sudo doesn't even see the redirection at all.
Password:
[jim@lnxserve jim]$ sudo cat /var/log/sudo*
Feb 24 06:56:59 : jim : TTY=tty4 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/cat /etc/shadow
Feb 24 06:58:49 : jim : TTY=tty4 ; PWD=/var/log ; USER=root ; COMMAND=/bin/cat /etc/shadow
Feb 24 07:02:35 : jim : TTY=pts/0 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/cat /etc/shadow
Feb 24 07:02:49 : jim : TTY=pts/0 ; PWD=/home/jim ; USER=root ; COMMAND=/bin/cat /var/log/sudolog
[jim@lnxserve jim]$
Tutorial pages:
|
© Copyright 2005 A.P. Lawrence
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "Using Sudo"
You must be logged in to post a comment.
Link to This Tutorial Page!

