Create a Windows Server with SFTP/SSH support
To support chef solo and one click testing of chef cookbooks on Windows Server we need to be able to run windows cmd commands remotely via SSH and copy cookbooks from our client to the servers via SFTP.
Core Concepts
SFTP
SSH File Transfer Protocol (also Secret File Transfer Protocol, Secure FTP, or SFTP) is a network protocol that provides file access, file transfer, and file management functionalities over any reliable data stream. It is provided as standard on Linux servers but is not supported as part of the standard Windows Server Operating System. Don't confused SFTP servers with Microsoft supplied FTPS, also know as SSL FTP. This is not compatabile with SFTP/SSH.SSH
Secure Shell (SSH) is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers. It is provided as standard on Linux servers but is not supported as part of the standard Windows Server Operating System.Start and Configure a Windows 2008 Server
1. Create a security group with port 22 and 3389 open.2. Start the latest Amazon Windows 2008 Server using the security group. At time of writing ami-eb3b019f amazon/Windows_Server-2003-R2_SP2-English-64Bit-Base-2012.05.10
3. Logon as Adminstrator via RDP
4. Turn off the firewall. (Control Panel -> Firewall)

5. Change the Administrator Password. (Administrative Tools -> Computer Management). Click on Local Users and Groups. Click on Users. Right Click on Administrator and select Set Password.

6. Set the computer name:
Go to C:\Program Files\Amazon\EC2ConfigService and double-click the Ec2ConfigServiceSettings application.
Your Windows instance displays the Ec2 Service Properties dialog box.
in the general tab make sure that set the compute name is checked.

7. Stop and start the server to get the ec2 configure changed. See Using EC2Config Service
Install WinSSHD Server
To work with chef we need an SFTP Server that works on Windows 2008 and supports SFTP and SSH shell. There are alot of old SFTP servers for windows out there but the only free one I was able to make work in Windows 2008 to support both SFTP file transfer and SSH remote commands was WinSSHD.
1. Download the the WinSSHD 5 installer from a href="http://www.bitvise.com/winsshd-download">http://www.bitvise.com/winsshd-download
2. Run the installer taking the defaults and install the free version.
3. Go into the WinSSHD management console and start the WinSSHD server.

4. Test you can access the SFTP server using say WinSCP.
5. Create an Image of the server.
Documentation on WinSSHD is available at http://www.bitvise.com/winsshd-doc-printable
NOTE: if you get error HostKeyMismatch trying to access the windows server via WinSCP on your PC go to C:\Users\
NOTE: This setup uses password access to SFTP and SSH. It is also possible instead to setup public key. See the WinSSHD docs for details.
References
Using SSH on Amazon EC2 Windows serversSetting up an Amazon EC2 Instance with an SSH Server, Mail Server, and an SSL Certificate