export PROMPT_COMMAND='RETRN_VAL=$?;logger \
-p local6.debug "$(whoami) [$$]: $(history 1 | \
Set the syslogger to trap local6 to a log file by adding this line in the /etc/syslog.conf file:sed "s/^[ ]*[0-9]\+[ ]*//" ) [$RETRN_VAL]"'
[for ubuntu it is /etc/rsyslog.conf]
root@ubuntu:/var/log# tail -f cmdlog.loglocal6.* /var/log/cmdlog.log
Apr 11 20:39:00 ubuntu root: root [8147]: [0]
Apr 11 20:39:06 ubuntu root: root [8147]: su – jahmed [1]
Apr 11 20:39:11 ubuntu root: root [8147]: ls [0]
Apr 11 20:39:13 ubuntu root: root [8147]: ls -ltra [0]
No comments:
Post a Comment