跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 有什么办法记录下 Linux 执行过的 history 命令
未分類
12 4 月 2021

有什么办法记录下 Linux 执行过的 history 命令

有什么办法记录下 Linux 执行过的 history 命令

資深大佬 : yanzhiling2001 1

记录下来 history,避免 history -c 或者其他命令清空执行历史
大佬有話說 (15)

  • 資深大佬 : zhoudaiyu

    使用 JumpServer 管理服务器(自带录屏和历史命令查询)

  • 資深大佬 : Rico

    history > history.txt ?

  • 資深大佬 : hei1000

    什么 shell ? bash 的话有~/.bash_history, fish 的话有~/.local/share/fish/fish_history 啊

  • 主 資深大佬 : yanzhiling2001

    @hei1000 #3 这个不错啊,厉害厉害,解决问题了。直接读取这个文件就可以了,history -c 清空了也能看到

  • 資深大佬 : raaaaaar

    记录下来?我在用 zsh 有个历史插件,不知道有没有用

  • 資深大佬 : 24bit

    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; }’

  • 資深大佬 : Skmgo

    /etc/profile history 从 1000 改为 0,这是我拿到每个新机器第一件要做的事情。

  • 資深大佬 : PMR

    Auditd forward remote rsyslog

  • 資深大佬 : css3

    ctrl + r

  • 資深大佬 : dengshen

    @Skmgo 这样做的意义是什么呢?不太懂

  • 主 資深大佬 : yanzhiling2001

    @dengshen #10 避免追踪。好多云都有监控。

  • 資深大佬 : dengshen

    @yanzhiling2001 GitHub 有个针对腾讯云监控的卸载脚步。执行以后面板就看不到 CPU 状态了

  • 主 資深大佬 : yanzhiling2001

    @dengshen #12 我直接 DD 新系统。肯定还有其他的内部监控手段。不如换个新的。

  • 資深大佬 : dengshen

    @yanzhiling2001 谢谢。还没试过 dd 这个操作

  • 資深大佬 : tomychen

    改 /etc/profile #6 给了
    patch bash

    https://github.com/iamseth/bash-syslog/blob/master/bash-3.2-syslog.patch

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具