Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently remotely upgrading a friend's computer with aptitude through SSH. I have bad memories of unstable systems when they are rebooted/shut down during an upgrade process, so I'd like to prevent him from rebooting the computer (he has a desktop session opened) when he comes back home if the upgrade is still running - or at least warn him.

How do I do that?

share|improve this question
If you open a text document, type some stuff, and leave it open, won't it prompt to save it before it shuts down? If you type something like "I'm SSH'd in, DON'T SHUT DOWN!", he'll see that if he tries to shut it down. – SaintWacko Sep 26 '12 at 14:38
A long long time ago.... (Slackware 2 time) the easiest solution was to start a shutdown with a long delay. If someone else tried to invoke a shutdown they would get a shutdown is already running error. (E.g. shutdown +10h "Wait with rebooting! I am busy atm. Joe.") – Hennes Sep 26 '12 at 16:38

Just remove him temporarily from the list of sudoers, or from any other group that would have access to the shutdown/reboot commands. You have to have special privileges to shutdown or reboot a machine.

share|improve this answer
Does this apply to all methods of shutting down, or just the command line? – SaintWacko Sep 26 '12 at 14:41
I'm not sure how "other methods" work, but from man reboot: These programs allow a system administrator to reboot, halt or poweroff the system. – m4573r Sep 26 '12 at 14:44
I mean from the menu in the GUI. Or is this a distro without a GUI? I don't have a ton of experience with the various flavours of Linux. – SaintWacko Sep 26 '12 at 14:51
I understood the question. I just don't know what method would be implemented in whatever desktop/window manager of whatever distro. I assume that ultimately it would resort to those commands, and that if you prevent the user to access it, it will do the trick. – m4573r Sep 26 '12 at 15:02
Oh, I see. Sorry, I misunderstood. I thought you were questioning the concept of other methods besides a command line reboot. – SaintWacko Sep 26 '12 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .