Shutdown without sudo user password in ubuntu

10

4

I'm setting up a minimalistic ubuntu based system with openbox as a window manager. Unlike the more full functioned window managers, there's no single click shutdown option. While i can shutdown using cli - this needs me to use sudo, and well, this isn't what i want. Is there any way to make the halt or poweroff commands work for any user, without the need for a password?

Journeyman Geek

Posted 2010-01-08T01:08:59.147

Reputation: 119 122

Answers

12

Run visudo and add %users ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot

So you can run sudo poweroff or sudo reboot without enter the user password.

livibetter

Posted 2010-01-08T01:08:59.147

Reputation: 1 497

0

You can configure ACPI to trigger a shutdown when the power button is pressed. In Ubuntu this is the default behavior if nothing else is running that handles the power management. Have a look at /etc/acpi/powerbtn.sh.

user16115

Posted 2010-01-08T01:08:59.147

Reputation: