Personal Solution Pac for Mac OS X
MGE SSH Utility



About MGE SSH Utility

The MGE SSH Utility enables the execution of remote shutdown (or other action) on several computers from the MGE Protection software "Personal Solution-Pac".
The solution is based on a secure shell session opened through SSH protocol provided on most Unix systems. SSH (secure shell) is an internet protocol that allows a user to connect to a remote host via an encrypted link.

The MGE Utility is a shell script for the configuration of SSH automatic connections needed to a shutdown script executed by the MGE Protection software.
This tool works in four steps:
1. Create a new certificate to enable authentication mechanism.
2. Asking you for remote computer name or IP address and for remote account name to use in remote session.
3. Merge your certificate to the authorized key file on the remote computer.
4. Test configuration validity by executing a command on the remote computer. (i.e. hostname command which returns the current computer name)

Pre-requisite

- The remote computer should have SSH server installed and SSH daemon started.
- To enable SSH daemon on a Mac OS X remote computer: edit /etc/hostconfig configuration file and change SSHSERVER=-NO- into SSHSERVER=-YES-. Restart the computer.
- You should have an account with enough rights to do what you want (i.e. shutdown the system) on the remote computer.

Set up passwordless SSH (Secure shell) between your remote server and UPS communication enabled machine

1. open up Terminal.app and get a root shell by running 'su root', you'll be prompted for your password.
2. change directory for the MGE SSH Utility package.
3. run ssh-config.sh configuration script for all remote computer. Be carefull, you should use the same "id_rsa" certificate file for all remote computers.
4. edit mgeShutdown.sh script to add remote shutdown command like this:

type vi /usr/sbin/mgePCtl.app/Contents/Resources/Scripts/mgeShutdown.sh

#!/bin/sh

############################################################
# Insert your shutdown customization commands here

# Shutdown remote computer(s)
ssh root@computer1 /sbin/shutdown now
ssh root@computer2 /sbin/shutdown now
ssh root@computer3 /sbin/shutdown now

#############################################################
# Standard shutdown feature

# Shut off UPS after 120 s
/usr/sbin/mgePCtl.app/Contents/MacOS/mgePCtl -shutdownUPS 120

# Shutdown without poweroff
#
(system will be gracefully shutdown in single user mode to
#
validate automatic restart)
/sbin/shutdown now

# Shutdown with poweroff
# (system will be gracefully poweroff
# but automatic restart capability will be disabled)
#/sbin/shutdown -hf now