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 have got the following line in my /etc/sudoers after editing it via visudo and I am unable to sudo without a password. Does anyone have any ideas on why this is not working properly?

myusername ALL=(ALL:ALL) NOPASSWD: ALL

share|improve this question
    
This works for me, although you could shorten it to myusername ALL = NOPASSWD: ALL. Did you log out and back in after you made the change? –  n.st Sep 14 '13 at 11:02
    
This still doesn't work even after I have re-logged in. –  Peter Sep 14 '13 at 13:00

2 Answers 2

I tried the above method with no success. Luckily, after hours of dedication I will spare anyone else from having this trouble again :)

%username% is the global variable for your username(replace it)

Open up a terminal windows and type

sudo usermod -a -G root %username%

Then type

sudo nano /etc/pam.d/su

Goto line 19 and remove the # before

# auth sufficient pam_wheel.so trust

Save your file. Problem solved :)

The first command adds your username to the group:root.

The second command allows all members of root to be su.

share|improve this answer

Ok, I fixed it. The line needs to be added to the END of the file and not just anywhere for it to work.

share|improve this answer

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.