Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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've installed hddtemp on my Arch Linux, but it needs to be run with root permissions. I want to execute it as a normal user without using sudo. How can I do this?

share|improve this question
up vote 6 down vote accepted

It's possible to assign users in a group permission to run an executable by using the /etc/sudoers mechanism. For instance, to permit all users in the users group to run hddtemp with root permissions run visudo as root and add:

%users ALL = (root) NOPASSWD: /path/to/hddtemp
share|improve this answer

You can make the program SUID. This is NOT a very safe way to do things, since SUID programs can often unintentionally open ways to escalate privileges, especially if the program wasn't intended to be run SUID. Unless the sudo solution is unacceptable for some reason (it's hardcoded into a script/program that you can't change), you should go with that. You can even make a script to hide the fact that sudo is being used if necessary.

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.