Linux用戶進行登錄及操作進行記錄

[root@i-07mge009 ~]# touch /var/log/Command_history.log [root@i-07mge009 ~]# chown nobody.nobody /var/log/Command_history.log [root@i-07mge009 ~]# chmod 002 /var/log/Command_history.log [root@i-07mge009 ~]# chattr +a /var/log/Command_history.log [root@i-07mge009 ~]#vim /etc/profile export HISTORY_FILE=/var/log/Command_history.log export PROMPT_COMMAND='{ date "+%Y-%m-%d %T ##### USER:$USER IP:$SSH_CLIENT PS:$SSH_TTY ppid=$PPID pwd=$PWD #### $(history 1 | { read x cmd; echo "$cmd"; })";} >>$HISTORY_FILE' #使配置生效 source /etc/profile
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章