Passwordless sudo setup

In Administration by Murat Demirten over 7 years ago 2 Comment

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:


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 add yourself in 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.
Hayabusa by Selçuk Mıynat over 7 years ago Reply this comment
It didn't work for me. But also try this one: Type "visudo" command as root (without quotes) and add this line to the "User privilege specification" part: username ALL=(ALL) NOPASSWD: ALL
If you are in a X session when adding your username to sudo group, you need to logout from X and login again. After that your new group changes will be active and you can run commands with sudo without password
You must be login first or sign-up for an account to post comments.