Skip to content

sudo with no password

Just a reminder on how to enable password-less sudo for a user.

The permissions for sudo is in a file /etc/sudoers you can not edit this file directly. You need to use the visudo command:

> sudo visudo

(you will probably have to enter your password.)

This will bring up the default editor with the contents of the file.

Then enter in at the end of the file the following.


Where username is your username. Then save the file and exit the editor. You will now be able to use sudo without a password.

sudo tips

  • sudo -e file to edit file as root.
  • sudo -u user command to run command as user user.
  • sudo -u user -i to run login shell for user.