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
nifty... this should be of use when we're working on projects
Post new comment