Prevent accidental shutdowns or reboots using Molly-Guard

So, this one day I was working on my computer late at night. I didn't know that my friend was accessing it remotely (ssh) and before going to sleep I ran "shutdown" command. After that I received a SMS instantly from him saying "Dude, what the f*** !! ". Even though the guy is really nice but as you can see these accidental shutdowns or reboots can cause a lot of trouble :P. Well linuxers, using Molly-guard you can prevent such things too.

Molly-guard installs a shell script that overrides the existing shutdown/reboot/halt/poweroff commands and first runs a set of scripts, which all have to exit successfully, before molly-guard invokes the real command. So, it checks for all the ssh sessions and a lot of other important stuff which are not in a state to handle system shutdown or reboot. I couldn't find an official website of molly-guard but if you are using debian or ubuntu you can install it from the repos. Run the following command.

[shredder12]$ sudo apt-get install molly-guard

1 Comment

December 19th, 2009 03:11 am

nifty... this should be of use when we're working on projects  

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <img> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <h1> <h2> <h3> <h4> <h5> <h6> <p> <br>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Search Engines will index and follow ONLY links to allowed domains.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.