1. ¼³Á¤¹æ¹ý # vi /etc/profile ...(Áß·«)... # [History User Trace & Time Log Config] where=`who am i | sed -e 's/(//' -e 's/)//' | awk '{print $1"@"$5"_"}'` today=`date +%Y%m%d%H%M` file=$where$_$today.log /bin/mkdir -p /var/log/who /bin/touch /var/log/who/$file export HISTSIZE=10000 export HISTTIMEFORMAT="%F %T : " export HISTFILE=/var/log/who/$file echo "[HISTORY USER TRACE & TIME LOG CONFIG ENABLED]" >&1 echo "[History file : $HISTFILE ]"
2. È®ÀÎ ¹× Å×½ºÆ® Connecting to xxx.xxx.xxx.xxx:22... Connection established. To escape to local shell, press 'Ctrl+Alt+]'.
############################################################ # # #All connetions are monitored and recored # #Disconnect IMMEDIATELY if you are not an authorizes user! # # # ############################################################ Last login: Thu Apr 30 13:59:28 2015 from xxx.xxx.xxx.xxx ############################################################ # # #All connetions are monitored and recored # #Disconnect IMMEDIATELY if you are not an authorizes user! # # # ############################################################ [HISTORY USER TRACE & TIME LOG CONFIG ENABLED] [History file : /var/log/who/root@xxx.xxx.xxx.xxx_201504301404.log ]
# tail -f /var/log/who/root@xxx.xxx.xxx.xxx_201504301404.log # cat /var/log/who/root@xxx.xxx.xxx.xxx_201504301404.log # history 1 2015-04-30 14:04:34 : tail -f /var/log/who/root@xxx.xxx.xxx.xxx_201504301404.log 2 2015-04-30 14:04:40 : cat /var/log/who/root@xxx.xxx.xxx.xxx_201504301404.log 3 2015-04-30 14:04:47 : history # pwd /var/log/who # ll total 20 -rw-r--r-- 1 root root 0 Apr 30 12:56 root@xxx.xxx.xxx.xxx_201504301256.log -rw-r--r-- 1 root root 388 Apr 30 13:25 root@xxx.xxx.xxx.xxx_201504301259.log -rw-r--r-- 1 root root 282 Apr 30 14:33 root@xxx.xxx.xxx.xxx_201504301404.log -rw-r--r-- 1 root root 107 Apr 30 14:47 root@xxx.xxx.xxx.xxx_201504301445.log -rw-r--r-- 1 root root 0 Apr 30 14:47 root@xxx.xxx.xxx.xxx_201504301447.log -rw-r--r-- 1 root root 17 Apr 30 14:19 root@xxx.xxx.xxx.xxx_201504301359.log
|