root 用户下
第一步
vi /etc/profile –添加如下内容
PS1="[`whoami`@`hostname`: "'$PWD]#'
history
USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'`
if [ "$USER_IP" = "" ]
then
USER_IP=`hostname`
fi
if [ ! -d /tmp/whodone ]
then
mkdir /tmp/whodone
chmod 777 /tmp/whodone