Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 made an alias to shut down my arch linux computer. It runs sudo shutdown -h -P now. I run it and am asked for my password and then it shuts down and powers off. Is there a way I can get this to run without it needing root privileges to run?

share|improve this question
up vote 5 down vote accepted

You can use visudo to edit your /etc/sudoers file and create an entry that allows your username to run shutdown without a password.

username hostname = NOPASSWD: /path/to/shutdown

See man sudo and man sudoers for more information.

share|improve this answer
Could I use a similar method to allow a user to update, but not install packages? that is, allow nopassword for pacman -Syu but not for pacman in general? – Seamus Aug 4 '10 at 17:07
@Seamus: Yes, from man sudoers: "If a Cmnd has associated command line arguments, then the arguments in the Cmnd must match exactly those given by the user on the command line (or match the wildcards if there are any)." – Dennis Williamson Aug 4 '10 at 17:28

Why not add yourself to the power group?

sudo gpasswd -a your_username power

share|improve this answer

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.