2

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

2
  • 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
    Commented Sep 14, 2013 at 11:02
  • This still doesn't work even after I have re-logged in.
    – Peter
    Commented Sep 14, 2013 at 13:00

2 Answers 2

4

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

1

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.

1
  • This does not answer the question, and represents what is usually a very bad idea. Commented Jul 20, 2015 at 22:45

You must log in to answer this question.

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