ope_log(){
echo "export PROMPT_COMMAND='{ msg=\(history 1 | { read x y; echo \$y; }); echo \"[euid=\$(whoami)]\":\$(who am i):[\$PWD] "\$msg"; } >> /var/log/command.log'" >> /etc/profile
sed -i 's/^HISTSIZE=.*/HISTSIZE=5000/' /etc/profile
echo -e "\n\nHISTTIMEFORMAT=\"%F %T \"" >> /etc/profile
source /etc/profile

#添加其他用户写入权限
touch /var/log/command.log
chmod 766 /var/log/command.log

}

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code