Super User is a question and answer site for computer enthusiasts and power users. 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 struggle to create passwordless sudo for one user on my Debian server. I've added the following line to the sudoers file:

deployer ALL = NOPASSWD: ALL

but it doesn't work.

To my surprise, I can easily create a new user

adduser deploy
passwd -l deploy
su deploy
touch somefile

add deploy ALL = NOPASSWD: ALL to sudoers, and

sudo cp somefile /etc/init.d/somefile

won't prompt me for a password.

Could you please explain what could be the difference between my existing user (deployer) and a new one (deploy), so that passwordless sudo would work for one, but not another?

share|improve this question
up vote 1 down vote accepted

Not enough info to make a 100% accurate response, but one possible cause would be that deployer is member of a group like e.g. wheel, which might get evaluated before the more specific rule you added later.

share|improve this answer
Thank you, @tink. It was the right guess. I ran groups deployer and saw that it belongs to two groups: "deployer" and "sudo". I removed the sudo group and now everything works as expected. – Ivan Zamylin Jan 28 '14 at 8:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .