Passwordless sudo


#1

If you want to give permissions to some users who are in a special group (probably sudo) to use sudo without asking password, you can do this simple in two steps:

First of all, you must add related users to group sudo. For example we can add bob to group sudo:

adduser bob sudo

And after that type visudo command and add or comment out following line:

%sudo ALL = (ALL) NOPASSWD: ALL

It says that password not required for the users who are in group of sudo.

Note: If you’re not in the sudo group previously when logging into X session and added yourself into the group sudo, you need to logout from X and relogin to group membership changes take affect. If you’re making this changes on a remote server through ssh, you need to logout from server and connect again.