Tuesday, September 25, 2007

allow shutdown for all users without password

set uid bit:
sudo chmod u+s /sbin/shutdown
and run shutdown without sudo.

alternative: Allow shutdown for all users in the admin group in the sudoers file (see here):
sudo visudo

Add at the end of the sudoers file:
%admin ALL=NOPASSWD: /sbin/shutdown

After logging out and in again, use sudo shutdown without the password prompt.

No comments: