Instructions
In this tutorial, you will understand how to configure passwordless sudo account on a Linux machine. After completing this tutorial, you can run super user commands (allowed) without entering a password.
Edit sudoers file using visudo command or use below command.sudo nano /etc/sudoers Update entry for your user account with NOPASSWD: option as showing below:username ALL=(ALL:ALL) NOPASSWD: ALL Change username with your user account and save file.
Test
All done, to test run any superuser command with sudo. The command syntax will be like: See the below screenshot before and after enabling the password-less sudo privileges for an account. The user needs to provide password before but after making changes the user can restart the apache service with sudo without entering the password.