jdong said: I'm one of the resident security geeks of these forums, and I'd like to point out a couple things along your search:
(1) It absolutely is possible to grant 'sudo' access for a particular user to only a subset of commands.
(2) It's also possible to grant 'sudo' access without requiring a password.
(3) The astute reader has figured out at this point that he wants both (1) and (2) simultaneously.
(4) Be careful when granting sudo commands to understand the command COMPLETELY to ensure there isn't some hidden way of abusing the fact that this one command has root access to get more root access. For example, it should be obvious why giving root access to only an editor is probably as bad as giving root access to the whole system.
(5) When authenticating over e-mail or other plaintext protocols, consider the possibility of identity spoofing. E-mail is freely viewable and spoofable by a number of people along the way to its destination. What stops me from copying your e-mail and sending it to your system whenever I want to shut it down? What you probably want is some sort of "Challenge Response Authentication Protocol" -- Read up on http://en.wikipedia.org/wiki/Challenge_response for a gist of what that is.
(6) The lazy reader will note people have written extremely secure authentication systems for you, such as SSH.
The most straightforward, responsible solution is probably a SSH login account which has passwordless sudo access to the shutdown command, perhaps with 'sudo shutdown -h now' stuck in the user's .bashrc. Then use a secure form of authentication such as SSH with a strong password or public key authentication to give authorized users access to this account.
(7) Any time when you grant partial sudo access like this, it's again entirely possible for a user to severely abuse this level of access to do bad things to your system. It's often not simple to think through all the possible ways that this kind of access can be abused. Proceed with caution.
THANK YOU SO MUCH! i've been trying to find a way to do 3 things with this. 1. shutdown. 2. logoff 3. restart me server. and you have given me great assitance in this, so i thank you very much. and yes i am aware that an email address can be spoofed, but can the authentication code on a SIM card be? not without a lot of work, and physical access to my phone.