Use mollyguard to prevent rebooting the wrong server


Mollyguard detects if you are logged in using ssh when you try to reboot or shutdown (unfortunatly init 6 works) a server. In this case you have to enter the hostname to proceed with the shutdown.

The installation is quite simple. Just use
apt-get install mollyguard

Afterwards you will be asked for the server-name when rebooting the server over ssh:

root@srv01:~# reboot
W: molly-guard: SSH session detected!
Please type in hostname of the machine to reboot:

If you would like to protect local sessions too, uncomment ALWAYS_QUERY_HOSTNAME=true in the config-file /etc/molly-guard/rc.

Leave a comment

Your email address will not be published. Required fields are marked *