監控服務器登錄用戶的操作腳本(linux下shell.sh)

linux下記錄所有用戶的登錄和操作日誌 在 /etc/profile文件末尾加入如下代碼: #vim /etc/profile history USER=`whoami` USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` if [ "$USER_IP" = "" ]; then USER_IP=`hos
相關文章
相關標籤/搜索