相伴江湖 -- Be With You

2008年2月6日星期三

linux普通用户关机


1. login in as root, creat a new user named "poweroff", with a primary group "poweroff".


2. run "visudo", add the following line in the last:


%poweroff ALL=(root)NOPASSWD:/sbin/shutdown


3. su poweroff, edit ~/.bashrc file and add the following line in it:


sudo shutdown -h now


4. now when you su to user "poweroff", the server will shutdown immediately.


Reference: http://www.ma.utexas.edu/users/stirling/computergeek/shutdown.html


标签: ,

0 条评论:

发表评论

订阅 博文评论 [Atom]



<< 主页