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 context, we shall look into how to configure a sudo user without a password in Linux Mint 20.
1. Test the Sudo Access with a Password on the system
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
2. Access the Sudoers File in the system
Now, for setting up a password-less sudo, we first need to access the Sudoers file with the following command:
$ sudo visudo
You will see the Sudoers file.
3. Modify the Sudoers File in the system
To add the following line to our Sodoers file:
username ALL=(ALL:ALL) NOPASSWD: ALL
Here, 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".
4. Check 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 will see 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.
This article covers the complete procedure of setting up a password-less sudo on a Linux Mint 20 system. In fact, Whenever we execute a command with "sudo" privileges, we are always asked to enter the "sudo" password before its execution. However, at times, you want to get rid of this hassle by disabling the "sudo" password.