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'm trying to make my sudoers file allow a user to adjust the backlight without having to enter in the password. This is what I have:

# User alias specification
Cmnd_Alias ADJBL = /usr/bin/su -c "echo 150 >/sys/class/backlight/intel_backlight/brightness"

# For our user..
ouruser HOME=(root) NOPASSWD:ADJBL

.. but it doesn't seem to be working, I still get prompted for the password when I try and run that command with sudo. Apparently there is something I'm missing here, any ideas?

share|improve this question
I assume that the alias is evaluated by the shell before the sudo rules are tested - ie, as written you would have to permit no-password access to /usr/bin/su - not ideal. – chronitis Dec 17 '12 at 10:54
what would be a better way of accomplishing my objective? – Eva Dec 17 '12 at 10:56
up vote 1 down vote accepted

Try to make a script and then let the use execute the script wthout password.



#User alias specification Cmnd_Alias ADJBL =

#For our user.. ouruser HOME=(root) NOPASSWD:ADJBL

then into the script:


sudo echo 150 >/sys/class/backlight/intel_backlight/brightness

anf add it to path. this should work.

share|improve this answer
how do you mean? the issue is that I cannot use that command without sudo, I want to use this command in a script, this is the reason that I'm trying to add it to sudoers – Eva Dec 17 '12 at 10:55
Evan, I edited my answer to explain myself better. – NotFromBrooklyn Dec 17 '12 at 15:43

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.