监控Linux用户操作

By admin, 25 十一月, 2015

限制history文件不可删除:

chattr +a .bash_history

在/etc/profile里添加如下命令:

 

export HISTFILE=$HOME/.bash_history

export HISTIGNORE=

export HISTTIMEFORMAT="%Y-%m-%d - %H:%M:%S "

 

typeset -r HISTFILE

typeset -r HISTIGNORE

typeset -r HISTTIMEFORMAT

 

shopt -s cmdhist

shopt -s histappend

 

PROMPT_COMMAND="history -a"

typeset -r PROMPT_COMMAND

使用ACCT工具双重监控。

参考:

标签

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"