SSH Keying Through PuTTY (Windows)

Installing & Using PuTTY in Windows

First you will need to download both PuTTY and PuTTYGen.  

Configuring PuTTY
  1. Run PuTTY
  2. In the "Host Name" field, enter your domain or server IP address.
  3. For "Connection>Data", enter the username you will connect with.  This will probably be your root account or cPanel account.
  4. Click "Session" at the top left of the window.  Enter a name to identify your settings.  
  5. Click "Save".
Connecting to the Server
  1. In PuTTY, click "Open".
  2. When it warns you of the possible security breach, click "Yes".
  3. You will now be at the bash prompt for your server.
Generating an SSH Key
  1. Start PuTTYGen.
  2. Select "SSH-2 RSA" under type of key to generate.
  3. Verify that bits are set to 1024.
  4. Click "Generate", and move your cursor around the blank space.  This motion is used to generate the key.
  5. Set the key comment, which is not very important, and the password, which is important.  
  6. Click "Save Public Key".  Note where the file is saved.
  7. Click "Save Private Key".  Note where the file is saved.
Placing Keys On The Server
  1. Copy the data inside the PuTTY window under "Public Key" to paste into the SSH Authorized keys file.
  2. Run the following commands in PuTTY:
    mkdir ~/.ssh
    chmod 700 ~/.ssh
    nano ~/.ssh/authorized_keys2
  3. Right click in the window to paste the key you copied earlier.  Make sure it's all on one line, and not broken up into multiple lines.
  4. Press "ctrl"+"x", then "Y", then hit enter.  
  5. Enter this command:
    chmod 600 ~/.ssh/authorized_keys2
Configuring the SSH Keys
  1. Close and re-open PuTTY.
  2. Click the profile you made and saved earlier, and then click "Load".
  3. Click "SSH>Auth".
  4. Click "Browse".  Find the private key that you saved in step 7 of "Generating an SSH Key".
  5. Go back to sessions, and click "Save".
Test

Re-open PuTTY.  It should make the connection to your server and send the SSH key automatically.


  • 43 Users Found This Useful
Was this answer helpful?

Related Articles

SugarCRM / CSS Style

If your CSS themes don't look right after installing SugarCRM CE, you might be able to fix it by...

Free DNS Hosting

NixiHost is proud to now offer free DNS hosting to existing customers.  Our free DNS hosting is...

Enabling mod_rewrite and mod_spelling

You must edit your .htaccess file, or create one if one does not already exist.  This article...

What do I need to do to put Flash on my website?

Flash is a client side feature - it runs on the user's computer, not on your web host. As long as...

Can I run scripts like Wordpress, Joomla, or phpBB on my site?

Absolutely! We make it extremely easy to install over 250 different scripts via the Softaculous...