文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>记录用户在登录后都输入了什么命令 (轉自CU)

记录用户在登录后都输入了什么命令 (轉自CU)

时间:2006-07-31  来源:snowtty

vi /etc/profile

添加如下内容:
# history
USER_IP=`who am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`

if [ "$USER_IP" = "" ]
then
  USER_IP=`hostname`
fi

if [ ! -d /tmp/.hist ]
then
   mkdir /tmp/.hist
   chmod 777 /tmp/.hist
fi

if [ ! -d /tmp/.hist/${LOGNAME} ]
then
    mkdir /tmp/.hist/${LOGNAME}
    chmod 300 /tmp/.hist/${LOGNAME}
fi
HISTSIZE=4096
export HISTSIZE
DT=`date "+%Y%m%d_%H%M%S"`
export DT
HISTFILE="/tmp/.hist/${LOGNAME}/${USER_IP}.hist.$DT"
export HISTFILE
chmod 600 /tmp/.hist/${LOGNAME}/*.hist* 2>/dev/null
umask 022
相关阅读 更多 +
排行榜 更多 +
小白调试

小白调试

系统软件 下载
和家相册

和家相册

系统软件 下载
胶卷相机2026

胶卷相机2026

图像拍照 下载