HOW TO: Configure FreeSSHd on Windows 2012 and Connect with Putty
13 December 2012
Recently I started playing around with Chef for a project. Chef needs SSH and setting SSH up on Windows is something I’ve not done before. I couldn’t find a set of good instructions so here goes.
This YouTube video helped http://www.youtube.com/watch?v=lwHktjugAYM
I used a AWS EC2 Windows 2012 x64 Server and Windows 8 x64 desktop.
Overview
- Install and configure FreeSSHd on the server
- Create keys
- configure Putty to connect to the server
Install FreeSSHd
- Download FreeSSHd from http://www.freesshd.com/?ctt=download
- Double click to start installer on the server
- As a service
- Accept all other defaults
Configure FreeSSHd
Open FreeSSHd settings (may have to kill the service and start manually to get the GUI)
- SSH tab:
- Max number = 2
- idle = 600
- Authentication tab
- Pub key folder = C:\Program Files (x86)\freeSSHd\keys
- Password auth = disabled
- Pub key auth = required
- Users tab
- add
- login=chef
- auth = ‘Pub key (ssh only)’
- user can use = shell
- click OK
Generate Public and Private keys
- Open PuttyGen
- Click ‘Generate’
- move the mouse pointer around as instructed to generate the key
-
Save a Putty compatible private key
- Click ‘Save private key’
- Save this to the client PC, Putty will need this
- You should really save with a passphrase for extra security
- Save OpenSSL compatible private key for Chef knife
- ‘Conversions’ menu > ‘Export OpenSSH Key’ > save as a *.pem
- Save the public key
- Copy the contents of ‘Public key for pasting into OpenSSH authorized file:’ and paste into a textfile.
- rename this file ‘chef’ (no file extension, the filename must match the user login name created above)
- drop this file into the public key folder C:\Program Files (x86)\freeSSHd\keys on the server.
Connecting with Putty
- Open Putty (or Putty portable)
- Enter the IP address of the server
- Connection type = SSH (obviously!)
- In the left menu tree
- Connection > SSH > Auth > ‘Private key file for authentication:’ > click browse
- Select the private key that was generated above
- Click ‘Open’
- when prompted ‘login:’ > enter ‘chef’ > hit enter
- If the private key was saved with a passphrase then enter this when prompted
- You should now be connected to the server.