place to discuss Linux
Prevent Accidental Shutdown/Reboot in Ubuntu
If you are a command line geek then you would have often entered the wrong commands many times, some of which could lead to accidental shutdown/restart. Molly-Guard is a command line script which prevents you from accidentally shutting down or rebooting your Ubuntu system.
It basically overrides the default system binaries of the shutdown, reboot, or halt processes. So once you try to reboot or shutdown your system form the command line it will prompt you to enter the hostname of your computer. Thus in this way you are prevented from accidental shutdown or reboot.
Installing this script is a piece of cake, open the terminal and run the following command:
sudo apt-get install molly-guard
Once the installation is over, try to reboot your system, you will get the message to enter the hostname of your machine to proceed.
Here is what happened with me when I attempted to reboot my Ubuntu laptop after installing the script.
————————————-
linuxadda:~$ sudo reboot
W: molly-guard: SSH session detected!
Please type in hostname of the machine to reboot:
—————————————-
| Print article | This entry was posted by Ashik on January 15, 2010 at 2:58 pm, and is filed under Debian, Software, Ubuntu. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |






about 2 months ago
I loved it, best in quite a while.