Configure sudo without password on Ubuntu 22.04 Jammy Jellyfish Linux

Are you tired of having to provide your administrator password when you use sudo? In this tutorial you will learn how to configure sudo without the password on Ubuntu 22.04 Jammy Jellyfish Linux. This means that the sudo command will not prompt you to enter password hence rendering your sudo command completely without a password.

WARNING
Configuring your sudo command with no password may lead to a security breach, hence leaving your system and data compromised. You are adviced not to proceed with sudo passwordless configuration except on test systems or in niche scenarios!

In this tutorial you will learn:

  • How to disable password for the sudo command
  • How to disable sudo password for a specific administrative commands
Configure sudo without password on Ubuntu 22.04 Jammy Jellyfish Linux
Configure sudo without password on Ubuntu 22.04 Jammy Jellyfish Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 22.04 Jammy Jellyfish
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Configure sudo without password on Ubuntu 22.04 step by step instructions



  1. First you might want to consider to disable sudo password only for a selected administrative command(s). To do so you need to edit the /etc/sudoers sudo configuration command using the sudo visudo editor. For example, to allow a single user eg. linuxconfig to execute the systemctl and reboot commands without sudo password add the following line into the /etc/sudoers configuration file:
    linuxconfig ALL=(ALL) NOPASSWD:/usr/bin/systemctl /usr/sbin/reboot 
    

    At this point executing the systemctl and reboot commands will not require sudo password.

  2. Next, if you wish the linuxconfig user to execute all commands using sudo with no password change the configuration line from Step 1 to:
    linuxconfig ALL=(ALL) NOPASSWD:ALL
    
  3. Lastly, in case you need all members of the sudo group to execute any commands using passwordless sudo, change the configuration line from Step 1 to:
    %sudo   ALL=(ALL:ALL) NOPASSWD:ALL
    

Closing Thoughts

In this tutorial, you saw how to disable the sudo password on Ubuntu 22.04 Jammy Jellyfish Linux. Most seasoned users know that typing the sudo password all the time can get tiring, but that is how you keep your system completley secure. If you are working with a test system or isolated computer, then this security recommendation can just be annoying and in those situations it is okay to disable the sudo password.