How to Stop Ubuntu From Asking for Your sudo Password

This short guide will explain how to configure Ubuntu so that you don’t need to type your password each time you use the sudo command.

If you use Ubuntu Linux it is quite likely that at some point or another you may have been frustrated at its asking for your password when trying to perform an administrative tasks, such as installing programs or changing system settings. Ubuntu uses the sudo tool to manage administrative rights rather than letting users easily log in as the root user. This is actually a good security measure. However, if you need to perform administrative tasks frequently it can get rather annoying. Here’s how you can set Ubuntu to not prompt for your password when using sudo.

Please Note: this is something that is not recommended if you are using your computer in a public place or at your work, as this will compromise the security of your data. You’re better off setting this at your home desktop where you are likely to trust more people.

Launch a terminal window and enter the following command:

# sudo visudo

Visudo is a tool used to edit the configuration file of sudo itself. The command will prompt your for your password. Enter it one last time. The configuration file will open in a text editor, most likely nano. Scroll down to the end of the document and add the following line:

username ALL=(ALL) NOPASSWD: ALL

Replace username with the username of the user you want to allow a passwordless sudo. So if the user is calvin, you would enter:

calvin ALL=(ALL) NOPASSWD: ALL

disable the Ubuntu sudo password

Save and exit the file. Log out, log in as the user calvin and test out your new passwordless sudo.

If you’re really tired of entering passwords, you can also sign into Ubuntu without having to enter your password every time.


If this article helped you, I'd be grateful if you could share it on your preferred social network - it helps me a lot. If you're feeling particularly generous, you could buy me a coffee and I'd be super grateful :)

buy a coffee for simplehelp.net


Home » Linux » How to Stop Ubuntu From Asking for Your sudo Password