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 tosudo
group, then the following won't have desired result:Reverse the order to get
max
passwordlesssudo
access: