How to sudo without password in Ubuntu

By default, when you run the sudo command on Ubuntu, you will need to enter your password. You can disable this by updating your sudo configuration. You may want to do this if you enable logging in via SSH key.

  1. Login to your server via SSH.
  2. Run the command:
    sudo visudo
  3. Add the following line to the bottom of the file. Replace "username" with your username.
    username ALL=(ALL) NOPASSWD: ALL
  4. Save andd exit.

Now you will no longer be prompted for a password when running sudo.

Article Information
  • Article ID: 394
  • Category: Ubuntu
  • Viewed 32 times.
  • Rating:
    (0)
  • Was this article helpful?
  • Yes No
Did you find this article helpful?