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
Ok, I fixed it. The line needs to be added to the END of the file and not just anywhere for it to work.
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.
myusername ALL = NOPASSWD: ALL
. Did you log out and back in after you made the change?