Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wish to create a shortcut key for reboot/shutdownfor all the users (including non-root users). I have tried creating a custom shortcut key Ctrl+R and assigned it to the command “gksu reboot” however Ubuntu requires root privileges to execute the command and throws up the message

Failed to run reboot as root The underlying authorization mechanism (sudo) does not allow you to run this program. Contact the system administrator.

I do not wish to give root privileges to the users and essentially want to execute the Shutdown/Reboot (that is usually accessed through the gear icon by all the users) through commands using shortcut keys

Can someone please help?

share|improve this question
up vote 0 down vote accepted

You can allow all users to run only the reboot command with no password, gksu should pick up this permission correctly. Add this to your sudoers file:

ALL ALL=NOPASSWD: /sbin/reboot

PLEASE don't edit sudoers directly. Use sudo visudo to get an editor, which will syntax-check the file once you save it. Append that line at the end, then save and exit it. If visudo finds a problem it will help you so you don't lock yourself out of your system.

share|improve this answer
That worked perfectly! Thanks for the help and also for the suggestion to use visudo. Interestingly the GUI option somehow does not need editing sudoers file. – Srini Jan 15 '14 at 20:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.