Have you ever mistakenly shut down or rebooted your operation-critical server while you were willing to halt your desktop computer through ssh before going to bed, or anything like this? If so, and if you are on Debian/Ubuntu, molly-guard is designed for you: this nifty bash script gets between you and the shutdown/reboot/halt tools, checking if you are connecting through ssh and if so asking for the hostname of the machine before proceeding.
Wondering how it looks? Here is the output of a little test:
ixce@timmy:~$ sudo shutdown -r
W: molly-guard: SSH session detected!
Please type in hostname of the machine to shutdown:
Good thing I asked; I won't shutdown timmy ...
Since it doesn’t correctly handle sudo yet (actually sudo is at fault here, since it drops SSH_CONNECTION environment variable when doing its stuff), you might want to add PRETEND_SSH around the beginning of /usr/sbin/shutdown as specified on Nico “nion” Golde’s blog.
You might also want to grab the molly-guard 0.3.2 etch package I backported from sid (all I changed is downgrade debhelper build-dep version and debhelper compatibility level in debian/compat since etch only has debhelper 5 and the sid package required debhelper 6 ; this shouldn’t break anything since the newer debhelper just seems to be needed to recognize a few fields in debian/control about where the package is maintained). Sources are also available, anyway.
Thanks hr for the tip
March 11th, 2022 at 10:39 am
Shizuko Charbonneau
I found a great…
March 11th, 2022 at 12:19 pm
Ryan Froncek
I found a great…
March 11th, 2022 at 5:33 pm
Reliable Private Proxies
I found a great…
March 12th, 2022 at 4:47 am
Order Cheap Proxies
I found a great…
March 14th, 2022 at 10:12 pm
Patrice Nuzback
I found a great…
March 15th, 2022 at 11:20 am
Buy Private Proxies
I found a great…
March 16th, 2022 at 5:25 pm
Google Proxies
I found a great…
March 17th, 2022 at 5:57 am
Kaci Ferard
I found a great…
April 1st, 2022 at 9:12 pm
Marty Dagen
I found a great…
April 4th, 2022 at 11:47 am
Best Proxy
I found a great…
April 8th, 2022 at 11:26 am
Unlimited Proxy
I found a great…