it is general topic and dream for many IT admins, where they no longer required to key in frustrating password for any admin job.

but is below syntax correct? have a try

# User privilege specification 
root      ALL=(ALL:ALL) ALL
username  ALL=(ALL) NOPASSWD: ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

 

i gave try for above syntax and not work.

 

let’s go with the correct one

sed -i -e 's/^%sudo\tALL=(ALL:ALL) ALL/%sudo\tALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers

then you will see following on your sudoers

# Allow members of group sudo to execute any command
%sudo ALL=(ALL) NOPASSWD: ALL

 

It’s all good now, enjoy your passwordless sudo

 

Leave a Reply

Your email address will not be published. Required fields are marked *