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. Therefore, we are here with this article that will guide you on how you can disable the “Sudo” password in Linux Mint 20 and Ubuntu 20.04.
Disabling the “Sudo” Password in Linux Mint 20
If you want to disable the “Sudo” password in Linux Mint 20, then you should perform the following three steps:
Step # 1: Access the Sudoers File:
First, you need to access the Sudoers file. This can be done by executing the command that follows:
$ sudo visudo
When you will execute this command, you will be asked to enter the “Sudo” password since we have used the “sudo” keyword with it. You need to type in your “Sudo” password and press the Enter key as shown in the image below:
Step # 2: Add a No Password Entry to the Sudoers File:
Once the Sudoers file is opened in the text editor, you need to scroll it all the way down to the “includedir /etc/sudoers.d” comment. Below this comment, you need to add the following entry:
kbuzdar ALL=(ALL) NOPASSWD:ALL
You can replace “kbuzdar” with your particular username. After that, you can close this file and exit from your text editor.
Step # 3: Test whether the “Sudo” Password is Disabled or not
Now, you need to verify whether the “Sudo” password has been disabled or not. You can simply do this by executing any command of your choice with “sudo” privileges just like we did below:
$ sudo apt update
This time, you will notice that the update process will immediately begin without even asking you for the “Sudo” password as shown in the following image:
If you want to enable the “Sudo” password again, you can simply remove the entry that you made in step # 2 of the method shown above. After removing that entry, you can simply save and close your file. Once you will do that, the “Sudo” password will be enabled again and you will be able to verify it by running any desired command with the “sudo” privileges.
This article provided you with a quick method of disabling the “Sudo” password in Linux Mint 20. Moreover, you can also re-enable it any time you want by following the pro-tip provided in this article.