# cd /etc
# vi profile
Add the lines below:
function history_to_syslog
{
declare command
command=$(fc -ln -0)
if [ "$command" != "$old_command" ]; then
logger -p local1.notice -t bash -i -- $USER : "$command"
fi
old_command=$command
}
trap history_to_syslog DEBUG
# vi rsyslog.conf
Add the lines below:
# Logging users BASH commands to syslog
local1.notice /var/log/cmd.log
By Renato
No comments:
Post a Comment