Lang_Development/BASH
[BASH] command log
Log Server# vi /etc/rsyslog.conf#$ModLoad imtcp#$InputTCPServerRun 514$ModLoad imtcp$InputTCPServerRun 514$AllowedSender TCP, 127.0.0.1, 10.3.1.0/24, 10.5.1.0/24 local1.* /var/log/cmd.log # service rsyslog restart CLIENT# vi /etc/profile.d/cmd_logging.shfunction logging{ stat="$?" cmd=$(history|tail -1|cut -d ' ' -f 5-) if [ "$cmd" != "$cmd_old" ]; then logger -p local1.notice "[NL2,2] STAT=$sta..
2013. 12. 9. 13:34
최근댓글