有什么办法记录下 Linux 执行过的 history 命令
本文由 vps网友提供,转载请注明出处
本文链接: https://www.vpsvsvps.com/discuss/a/1676472071472812032.html
本文由 vps网友提供,转载请注明出处
本文链接: https://www.vpsvsvps.com/discuss/a/1676472071472812032.html
改 /etc/profile #6 给了
patch bash
https://github.com/iamseth/bash-syslog/blob/master/bash-3.2-syslog.patch
@yanzhiling2001 谢谢。还没试过 dd 这个操作
@dengshen #12 我直接 DD 新系统。肯定还有其他的内部监控手段。不如换个新的。
@yanzhiling2001 GitHub 有个针对腾讯云监控的卸载脚步。执行以后面板就看不到 CPU 状态了
@dengshen #10 避免追踪。好多云都有监控。
export PROMPT_COMMAND='{ msg=$(history 1 | { read x y; echo $y; });echo $(date +"%Y-%m-%d %H:%M:%S") [$(whoami)@$SSH_USER$LOGIN_IP `pwd` ]" $msg" >> /var/log/.history; }'
@hei1000 #3 这个不错啊,厉害厉害,解决问题了。直接读取这个文件就可以了,history -c 清空了也能看到