No Password Prompt When Using Sudo

January 2, 2014 | By
| Reply More

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

or

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)

or

entering the command

logout

or

exit

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

username ALL=(ALL) NOPASSWD: ALL

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!

Filed Under : HOWTOS, UBUNTU HOWTO

Free Linux Ebook to Download

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.