Disabling password for sudo in Ubuntu

Disabling the password needed for sudo for a specific user is very easy in Ubuntu. This method applies to Ubuntu 16.04, but probably also other versions of Ubuntu and maybe even other distros.

First, run the following command:

sudo visudo

Note: If this is the first time you’re running this command, you’ll most likely be presented with a list of editors to choose from. Choose the one you’re most comfortable with.

Then enter the following line at the end of the file:

user ALL=(ALL:ALL) NOPASSWD:ALL

Make sure to replace user with the username of the user you want to allow using sudo without entering a password.