
Originally Posted by
TeaSwigger
Hello mojoman, thanks for the great tip. I followed your suggestions and it works great. What I was doing before was:
Code:
[exec] (Shutdown) {konsole /sbin/shutdown -h now}
Of course I'm using fluxbox on KDE/Kubuntu and Gnome/ubuntu users would have to change it appropriately. What this does is make the terminal window pop up prompting for the password (if you've not entered it in the past 15mins; if you have it proceeds with shutdown without waiting to open a terminal window). Enter the pass and it shuts down. Just a suggestion for anyone not willing or inclined to edit sudoers.

You can get around the problem of passwords for shutdowns and restarts by modifying the /etc/sudoes files.
Code:
sudo nano /etc/sudoers # or whatever text editor you prefer instead of nano, like kate/emacs/gedit
Add the following line:
Code:
# Passwordless shutdown and reboot
my_user_name ALL=(ALL) NOPASSWD: /sbin/shutdown -h now, /sbin/reboot
Now user my_user_name can run 'sudo reboot' or 'sudo halt' without a password
You can modify your menu for the following options:
Code:
[exec] (Log out)
[exec] (Reboot) {sudo /sbin/reboot}
[exec] (Shutdown) {sudo /sbin/shutdown -h now}
This will not require passwords and it will be immediate.
Bookmarks