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/
时间: 2024-10-09 21:18:22