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.
Firstly you can enter the command
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
Another way is to enter the command
which will open the settings for the sudo command.
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!