Whenever you try to run any command for the first time in the Linux terminal while using the “sudo” keyword in a new terminal session, you are always required to provide the sudo password before you can execute that command. However, there might be such situations in which you need to launch a new terminal session for performing every new task. In such situations, you might find it a burden to provide the sudo password every time. Therefore, you might feel the need of disabling it. In this guide, we are going to teach you the method of configuring a sudo user without a password in Linux Mint 20.
Method of Setting up a Sudo User without a Password in Linux Mint 20:
For setting up a password-less sudo on Linux Mint 20, you have to perform the following steps:
Step # 1: Testing the Sudo Access with a Password in Linux Mint 20:
First, we would like to show you what happens whenever you execute a command with the “sudo” keyword for the first time after launching a new terminal session. The test command is as follows:
$ sudo apt-get update
You can see that as soon as we executed this command, we were asked to provide the sudo password before proceeding any further. This is shown in the image below:
Step # 2: Accessing the Sudoers File in Linux Mint 20:
Now, for setting up a password-less sudo, we first need to access the Sudoers file with the following command:
$ sudo visudo
The Sudoers file is shown in the image below:
Step # 3: Modifying the Sudoers File in Linux Mint 20:
After that, we need to add the following line to our Sodoers file:
username ALL=(ALL:ALL) NOPASSWD: ALL
Replace “username” with the name of the user account for which you want to disable the sudo password. After adding this line, we have simply saved and closed our file with “Ctrl+ X”.
Step # 4: Checking whether a Password-less Sudo has been Configured or not:
Now, we need to check whether a password-less sudo has been set up or not. For that, we will run the “update” command again with the “sudo” keyword. You can see in the image shown below that this time, our Linux Mint 20 system did not ask for the sudo password which means that a password-less sudo has been set up successfully.
In this guide, we taught you the complete procedure of setting up a password-less sudo on a Linux Mint 20 system. However, in the end, we would like to recommend enabling the sudo password again as soon as you get done with the task for which you had disabled it earlier. It is so because disabling the sudo password is not considered a secure practice. For enabling it again, you simply need to remove that line from your Sudoers file that you had added in the third step of this method.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.