码迷,mamicode.com
首页 > 系统相关 > 详细

Linux用户进行登录及操作进行记录

时间:2019-07-01 12:27:48      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:tty   vim   att   root   配置   prompt   command   lin   his   

[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

Linux用户进行登录及操作进行记录

标签:tty   vim   att   root   配置   prompt   command   lin   his   

原文地址:https://blog.51cto.com/hsuing/2415673

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!