将linux操作记录到 /var/log/message 中
时间:2016-08-03 15:45:28
收藏:0
阅读:1369
vim rsys.sh
cat >> /etc/profile <<EOF HISTFILESIZE=2000 HISTSIZE=2000 HISTTIMEFORMAT="%Y%m%d-%H%M%S: " export HISTTIMEFORMAT export PROMPT_COMMAND=‘{ command=\$(history 1 | { read x y; echo \$y; }); logger -p local1.notice -t bash -i "user=\$USER,ppid=\$PPID,from=\$SSH_CLIENT,pwd=\$PWD,command:\$command"; }‘ EOF echo "127.0.0.1 secaudit.xf.conf" >>/etc/hosts echo ‘:msg,contains, "Did not receive identification string from 127.0.0.1" ~‘ >>/etc/rsyslog.conf echo "authpriv.* @secaudit.xf.conf" >>/etc/rsyslog.conf echo "local1.notice @secaudit.xf.conf" >>/etc/rsyslog.conf service rsyslog restart
本文出自 “智能化未来_XFICC” 博客,请务必保留此出处http://xficc.blog.51cto.com/1189288/1833808
评论(0)