molly-guard =========== molly-guard attempts to prevent you from accidentally shutting down or rebooting remote machines. It does this by injecting a couple of checks before the existing commands: halt, reboot, shutdown, and poweroff. It does this by putting scripts with the same names into /usr/sbin, so it only works if you have /usr/sbin before /sbin in your $PATH! The checks are: - test whether the current pty has been created by sshd - test whether a variable $SSH_CONNECTION exists If any of these tests are successful, molly-guard asks you to type the machine's hostname, which should be sufficient to prevent you from doing something by accident. The following situations are still UNGUARDED. If you can think of ways to protect against those, please let me know! - running sudo within screen or screen within sudo; sudo eats the $SSH_CONNECTION variable, and screen creates a new pty. - executing those command in a remote terminal window, that is a XTerm started on a remote machine but displaying on the local X server. You have been warned. You can use the --molly-guard-do-nothing switch to prevent anything from happening, e.g. halt --molly-guard-do-nothing -- martin f. krafft Wed, 12 Mar 2008 20:02:14 +0100