Use sudo Without Password in Linux

Use sudo Without Password in Linux

When executing commands as sudo user in Linux, the system asks to provide password for authentification. It might be annoying when system is used for testing purpose. This tutorial shows how to use sudo without password in Linux.

To configure sudo to never ask for your password, run the following command to edit /etc/sudoers file:

sudo visudo

Add the following line in the bottom of the file:

USERNAME ALL=(ALL) NOPASSWD:ALL

Replace USERNAME with your username on system. For example, the following entry allows to run commands as sudo without asking password for a user john:

john ALL=(ALL) NOPASSWD:ALL

Save and close the file.

Leave a Comment

Cancel reply

Your email address will not be published.