Linux Mint

How to configure a passwordless sudo in Linux Mint

Sudo, also known as superuser do, enables a system administrator to assign permission to certain users to execute the commands. This command increases privileges temporarily, allowing users to conduct critical operations without logging in as the root user. As a result, you need to input your login credentials into the system for authentication, verifying that you have the rights to conduct operations.

However, typing this information repeatedly is a time-consuming operation, but you can disable authentication in specific ways if you like to. So, this article will provide you with details on how you can configure a password-less sudo on Linux Mint. This is only recommended if you are a sole user on the system and no one else is using it except you; otherwise, the authentication feature should be enabled for security reasons.

Configure a Password-less Sudo

Because the sudoers file defines which users are allowed to do administrative operations needing superuser rights, it’s a good idea to take safeguards while modifying it, which visudo does. It locks the sudoers file so that no one else may modify it at the same time.

To configure a password-less sudo, you need to type.

$ sudo visudo

Graphical user interface, text, application Description automatically generated

This will open your sudoer file in the default editor, like nano in our case. After that, you need to add a line in the file, the general syntax is given below.

$ <user_name> ALL=(ALL:ALL) NOPASSWD: ALL

Replace the “<user_name>” with the name of the user you want to give access.

Text Description automatically generated

So before permitting any specific user, you can see from the image below when I ran the command mentioned below, it was asking for a password, for example:

$ sudo apt update

Now we can set the user to check if it’s still asking for a password or not by doing some changes on the sudoer file as shown below.

Here, username represents the name of the user to whom you want to give the rights for sudo less password. For example, in our case we can write:

$ taimoor ALL=(ALL:ALL) NOPASSWD: ALL

So now we will run the same command again to verify if it’s asking for a password or not.

$ sudo apt update

Text Description automatically generated

You can see from the above image that this time it did not ask for a password and started executing the command directly. You can test this on other applications as well. For example, we would like to install a java development kit.

$ sudo apt install default-jdk

Text Description automatically generated

You can see that the application starts executing again without asking for a password, so you can install any application without providing your password every time.

Conclusion

Having credentials as a Linux Mint user is essential to save your system from security breaches. However, doing that every time can be tiresome for some users, so they look for a way to get rid of it. This is where this article comes in handy, as it has all of the necessary information to give you a passwordless method of installing various programs. Keep in mind that doing so isn’t a smart idea; it should only be permitted if you’re the only one utilizing your system.

About the author

Taimoor Mohsin