history命令添加时间及记录到syslog日志

history记录中添加时间,用户地址等信息html

vi /etc/profilelinux

export HISTTIMEFORMAT=" %F %T `who -u am i 2> /dev/null | awk '{print $NF}' | sed -e 's/[()]//g'` `whoami` "web


history记录添加到 syslog日志bash

vi /etc/profile
ide

export PROMPT_COMMAND=' history -a >(tee -a ~/.bash_history | logger -t "$USER[$$] $SSH_CONNECTION") '
日志


source /etc/profilehtm


参考:get

https://backdrift.org/logging-bash-history-to-syslog-using-traps
it

http://webplay.pro/linux/syslog-log-bash-history-every-user.html class

相关文章
相关标签/搜索