linux 安全审计

1,创建工作目录mkdir /usr/local/proxy/

vi proxy

#!/bin/bash
Tmpfile=`mktemp`
User=$USER
Ip=${SSH_CLIENT%% *}
Date="`date +%Y-%m-%d`"
Logfile="/var/log/myaudit/${Date}_${User}_$Ip.log"
exec /usr/bin/script -a -f -q $Logfile

2 修改/etc/profile
vi /etc/profile 
/usr/local/proxy/proxy

3,
tail -f /var/log/myaudit/

你可能感兴趣的:(linux,安全审计)