Samir Parikh / Blog


Originally published on 09 October 2019

I recently had to spin up a temporary virtual machine to test out some things and got tired of having to continually enter the user's password every time I had to execute a sudo command. To disable this, execute the following command:

$ sudo visudo

and append the following line to bottom of the file:

<username> ALL=(ALL) NOPASSWD: ALL

where <username> is the username of the account. Make sure this line comes at the end of the file.

Note: The visudo command uses vi key bindings to move the cursor, save the file and to exit.

Once you log out and then log back in, you will no longer be required to enter a password when you run a sudo command.