How to enable a non-root user to shuwdown a linux system
First, you need a non-root user, go and create it using root account
[root@deniro ver]# useradd -d /home/vertito vertito -s /bin/bash && passwd vertito
This would create a new bash-enabled user prompting you for a new password.
You then edit /etc/sudoers file by launching your favorite editor like so
[root@deniro ver]# nano -w /etc/sudoers
or simply
[root@deniro ver]# visudo
and inserting
SHUTDOWN localhost=/sbin/shutdown -h now
and save.
Logout as root and login as user vertito. User vertito was the last user created a while ago.
[vertito@deniro ~]$ /sbin/shutdown -h now
Just make sure /sbin/shutdown is world readable and executable as mine is not! !
Further readings:
man sudo
man shutdown
man sudoers
sources: WWW
application: dont reboot, shut it down, makes work simple!
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Thursday, June 1, 2006
shutdown using non-root
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment