This trick can be useful in case we are the only user using the same machine. Being asked each time for a sudo password can be really grueling.
Open the sudoers file :
sudo visudo
add this line :
sc ALL=(ALL) NOPASSWD: ALL
This will allow user "sc" to run all commands without a sudo password.
In case we want the user to run only specific commands :
sc ALL=(ALL) NOPASSWD: /usr//bin/shutdown, /usr/bin/reboot
To allow all members of the demo group to run all commands without a sudo password
%demo ALL=(ALL) NOPASSWD: /usr//bin/shutdown, /usr/bin/reboot