Re: How Do I Remotely Shut Down My SSH Server?
You cant do that unless you allow the user to run sudo without a password for a specific command
Originally Posted by Plumtreed
You see - sudo requires a password when you run it - by running it in that form, sudo has no way of asking for a password.
To allow shutdown to be run without a password,
Add at the bottom
restart (it sometimes needs it), and sudo wont ask for a password for the shutdown command
%sudo ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
The line makes it so that sudo will not ask for a password when running /sbin/poweroff, /sbin/reboot, or /sbin/shutdown with sudo
Don't waste your energy trying to change opinions ... Do your thing, and don't care if they like it.