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.

  1. Open the sudoers file :

    sudo visudo
  2. add this line :

    sc ALL=(ALL) NOPASSWD: ALL

    This will allow user "sc" to run all commands without a sudo password.

  3. In case we want the user to run only specific commands :

    sc ALL=(ALL) NOPASSWD: /usr//bin/shutdown, /usr/bin/reboot
  4. 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

Previous Post Next Post