Linux开启同步history记录到messages

在服务器/etc/bashrc中开启history同步记录到messages中

export PROMPT_COMMAND='{ msg=$(history 1 | { read x y; echo $y; });logger"[euid=$(whoami)]":$(who am i):[`pwd`]"$msg";  }'

source/etc/bashrc                  #要记录普通用户,就在普通用户执行


猜你喜欢

转载自blog.csdn.net/slovyz/article/details/53198419