I am trying to add NOPASSWD
option for existing user who belongs to the sudo
group and have admin rights. I added this line in sudoers
file:
max ALL=(ALL:ALL) NOPASSWD: ALL
But it still ask me for password when i try to execute command with sudo
.
The sudoers
file is parsed line by line and the last rule prevails for a given user.
So, you need to add this rule after all other rules applicable for the given user to have this in effect.
For example, if the user max
belongs to sudo
group, then the following won't have desired result:
max ALL=(ALL:ALL) NOPASSWD: ALL
%sudo ALL=(ALL:ALL) ALL
Reverse the order to get max
passwordless sudo
access:
%sudo ALL=(ALL:ALL) ALL
max ALL=(ALL:ALL) NOPASSWD: ALL
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments