How to use Sudo without password on Linux

How to use Sudo without password on Linux

If you are the only one using your Linux computer, why does he keep asking you for your password? Let’s see how you can use sudo without having to type a password every time.

Note: we will see how to disable the sudo password in the latest version of Ubuntu. The details of the process may be different in other distributions.

Edit the Sudoers file

To deactivate password verification when using sudo for your account, you must modify the “sudoers” file. This is where access rights tosudo are defined for individual user accounts or user groups. However, it would be best not to try to modify the file directly. Instead, run your preferred terminal and enter:

Disable password Sudo Sudo Visudo

Disable Sudo password for your account

To prevent sudo from asking you for your password, first check if there is an existing rule with your alias. If so, replace it with what we will see next. If there is none, go to the end of the file and create a new rule there. It should look like:

For my alias, this rule was:

Disable Sudo Password Sudoers fileDisable Sudo Password Sudoers file

Save the changes and exit the editor. Since in our installation the editor was nano, we used Ctrl + O, followed by Ctrl + X.

Use Sudo without a password

That’s all you have to do – from now on, sudo will no longer ask you for your password, as long as everything goes as planned and no typos thwart our plans. Find out with an order like sudo apt updateor by installing an application with sudo apt install as a test, for example:

Disable Sudo Password Sudo TestDisable Sudo Password Sudo Test
Disable installation of Sudo password testDisable installation of Sudo password test

Do not disable Sudo passwords for everyone

If you share your computer with other people and don’t want them to have to enter their passwords every time they use sudo, don’t do it. In fact, there should only be one primary user with the sudo privilege.

READ:   Top 5 Most Useful Productivity Flatpaks

Sudo is no longer considered a security measure against users with local access to our equipment. It is not that difficult to reset the root password if you have local access to a Linux installation. Instead, it’s there for the same reason as annoying Windows user account control: as a final layer of protection between us, our computer, and potential chaos. And this is because an incorrect order can lead to the deletion of all our data, the destruction of our installation or the involuntary sharing of personal information.

Disabling the sudo password is only valid for those who have good Linux command line experience and are the only user on their computer.

It should be noted that this removes this last barrier of protection between a user and his own errors. We strongly suggest that you also make a full backup of your system and all of its data before doing so.


Is this article useful?

s.parentNode.insertBefore(t,s)}(window, document,’script’,
fbq(‘init’, ‘400239050508508’);
fbq(‘track’, ‘PageView’);


More Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed