Windows: Generating SSH keys

Generating your SSH key-pair
Windows has no native console, so we use a pair of programs called Putty, and Puttygen to generate the ssh keys and connect to the server using the keys and SSH.

  1. Download Putty and Puttygen here.

    They are standalone applications and no installation is required.

  2. Launch Puttygen
  3. Select SSH2 for type, and remove any value in the bit length field.
  4. Click Generate and follow the instructions. The key information is displayed in the upper section of the dialog box.
  5. Select all the text in the "Public key for pasting into authorized_keys file" section and copy by pressing Ctrl-C. Paste this public key into an email and send that email to support@advomatic.com You may also want to save it to a text file on your computer where you can retrieve it later as it is your public key, and may be shared freely.
  6. Type a passphrase in the Key passphrase and Confirm passphrase edit boxes.
  7. Click Save private key. Save the PuTTY private key file into a directory private to your Windows login (in the Documents and Settings/(userid)/My Documents subtree in Windows 2000/XP) where you will be able to remember and find it later.

Connecting to the server with your SSH key and Putty

  1. Invoke putty.exe
  2. Click "Session" in the sidebar.
  3. Enter ip address or hostname of your server (e.g., 192.168.1.2)
  4. Click "SSH" in the Protocol option
  5. Choose "SSH" under "Connection" in the sidebar
  6. In "Preferred SSH protocol version", select "2 only"
  7. Click "Auth" under "SSH"
  8. Click the Browse button, select the private key file you saved in Step 7, likely named "id_rsa.ppk".
  9. Click "Session" again, like in step 9
  10. Enter a name (e.g. "toylet.session") in the textbox directly under "Saved Sessions".
  11. Hit the "Save" button. The name "toylet.session" would appear in the listbox of "Saved Sessions".
  12. Double-click "toylet.session". Now you would be presented with a login screen for OpenSSH.
  13. Enter the linux user name for the server, generally the shortname we have given the client
  14. Enter the passphrase for your private key that you specified in step 6. You should get:
    Login as: (username provided)
    Authenticating with public key "imported-openssh-key"
    Passphrase for key "imported-openssh-key":
    Last login: Wed May 31 12:35:00 2006 from 192.168.1.10
    username@server:~$
  15. You have successfully logged into your Linux server via OpenSSH.
  16. Type "exit" and hit enter to logout. You now at least know the keys are working, so connection problems with other clients is likely a configuration or setting on the client as opposed to a problem with the key.

    images used from http://www.linux-sxs.org/networking/openssh.putty.html

Contact Us
Drupal Association The Drupal Association is an organization dedicated to helping the open-source Drupal CMS project flourish. We help the Drupal community with funding, infrastructure, events, promotion and distribution. See how Advomatic is contributing back to the Drupal community.