No Password Prompt When Using Sudo

While using the terminal in linux you will most likely end up using the command “sudo” in order to gain access to root privileges. Using the sudo command will cause your computer to prompt you for a password. This is to protect your computer from people other than yourself.

However if you are entering a lot of commands it can become tedious to enter in your password over and over.

There are a number of ways you can get around this.

Using Root

Firstly you can enter the command

sudo -i


sudo bash

This will put the user in root and give your user permission to do anything without requiring the sudo command.

You can leave root by

Pressing (ctrl + d)


entering the command




Disable Password

Another way is to enter the command

sudo visudo

which will open the settings for the sudo command.

Sudo Visudo

On the bottom line add


Ubuntu uses “Nano” to edit this file. You will need to navigate the text using your arrow key, and to save you must press (CTRL+X) and then (y)

If you are using the VI editor you will have to navigate using (h), (j), (k), and (l). To save hit ESC, then enter “:wq”.

This will make is so the sudo command is still required for root privileges, but a password is no longer required.

Now you will no longer have to enter your password over and over!

About William Schaller

William Schaller is a Computer Science Major at California Polytechnic University and an experienced Linux user/programmer.

Author Archive Page

Have anything to say?

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

All comments are subject to moderation.