WandS v. 1.0
WandS (Wake and Shutdown) is an program for webmaster or
sysadmins that want take control over your servers at datacenter. With
WandS, you can shutdown or awakening any servers or servers group in
any time through protocol SSH or SMB
Main window
The roster contains groups and every group contains servers. You can
shutdown or awakening any servers group or a few servers. When you send
shutdown signal, appear an window events with the command results.
Working with the roster
New group

Create an new group is very easy. Go to file menu and New Group click. Two data are
required for the new group, the name
and location. You can verify too if group exist at the button with
caption V.
New server

You can add an new server through the context
menu of the group. The required data are: Hostname, IP address, MAC
address, group and profile. MAC address is very important for awakening
the server, through it, can send signal WOL (Wake On LAN).
Remote shutdown

For remote shutdown, first, select the target, then click on shutdown
button.
In the panel shutdown options you can set:
- Time wait
- Message
- Reboot after shutdown
- Force shutting down all applications (Valid only for MS Windows)
- Show progress. Display the events dialog with the command result
Wake On Lan (WOL)

For WOL, first, select the target, then click on Wake button.
Optionally you can set the IP address for WOL, default is
255.255.255.255
Profiles and SSH shutdown
Profiles

You can create profiles in accordance with the target, can be protocols
ssh or smb.
With SSH, can set the command from the list. See SSH Shutdown.
With SMB can set username, password and domain for the target. Remember
that this account have privileges for shutdown the remote target.
SSH Shutdown

You can set the remote command for the Unix target. By default, there
some commands in accordance with the remote operating system, you can
modify or create an new.
The flags are:
:RflagR: Relative at the reboot flag
:MflagM: Relative at the message
:TflagT: Relative at the time wait
Settings
General

Log events: Logging each command
Iconify instead of close window: Show the icon on the systray
Scan host on expand group: Show if the target is online or offline
Start with system: Launch WandS at the log-in system
Programs

Setting of ssh client and the net command for shutdown over ssh and smb
Backup and Restore
Backup

You can make backup the roster on any time. Select the destination directory and click on Backup button
Restore

You can restore the roster on any time. Select the backup file and click on the button Restore
Setting of enviroment SSH for remote shutdown
Workstation
1. Download puttygen.exe and plink.exe from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
Then, copy plink.exe to WandS directory
2. Make RSA key (public and private)
Use PuTTYGen tool for create both keys

Click on Generate button and move the mouse pointer over the window. Leave Key passphrase in blank
Private key
Save the private key making click on button Save private key, type key.ppk.
Public key
Save the public key making click on button Save public key, type id_rsa.pub. Then, copy id_rsa.pub to remote server
Target (Remote server)
3. Import public key with: cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
4. Setting the remote ssh server
Edit /etc/ssh/sshd_config
PasswordAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
5. Reboot ssh server
#/etc/init.d/ssh restart
Workstation
Test ssh public key from the workstation
Open the command prompt y change to WandS directory, then type
plink.exe -i llave.ppk -l lgcoft
Where: lgcoft is the user that allow to shutdown
Ask for password?, No?, perfect
6. Setting WandS, see Setting ssh client
Target (Remote server)
7. Setting sudo
Modify /etc/sudoers
Adding the line below to that file, assume lgcoft is the user that allow to shutdown without password.
lgcoft ALL = NOPASSWD: /sbin/shutdown