建立linux自动关机用户

技术分享 Story 111浏览 0评论

建立linux自动关机用户
以root用户登录
adduser down
passwd down
#vi /etc/sudoers //添加下面一行
down ALL=NOPASSWD: /sbin/shutdown -h now
然后修改/etc/profile
if [ $LOGNAME = 'down' ]
then
         echo 'he machine will shutdown now! please logout!'
                 sleep 5
                       /usr/bin/sudo /sbin/shutdown -h now
                                exit
                               fi

转载请注明:成长的对话 » 建立linux自动关机用户