Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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 at 8:36

Your Answer

 
discard

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.