Categories: Ubuntu

How to Disable the “Sudo” Password in Linux Mint 20 and Ubuntu Linux

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:

Pro-Tip

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.

Conclusion

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.

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn

Recent Posts

How to Install Magento 2 on AlmaLinux

Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…

1 year ago

How to Install ISPConfig Hosting Control Panel with Apache Web Server on Ubuntu 24.04

ISPConfig is an open-source control panel that allows users to manage multiple servers from a…

1 year ago

How to Test your Email Server (SMTP) Using the Telnet Command

As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…

1 year ago

Managing Network Interfaces and Settings on Ubuntu 24.04 with nmcli

Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…

2 years ago

Using Restic Backup on Ubuntu 24.04

Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…

2 years ago

Installing phpMyAdmin on Rocky Linux 9 and Securing it with Let’s Encrypt SSL

phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…

2 years ago