Difference: SSHPUTTY (2 vs. 3)

Revision 32016-04-19 - ChrisBrew

 
META TOPICPARENT name="WebHome"

How to use SSH keys with PuTTY

This article describes how to use PuTTY for passwordless SSH access via public/private key pairs.

  • Open the PuTTYgen utility which comes along the PuTTY suite of programs:
PuTTYgen1.png

  • Click on Generate to start generating a public/private key pair
  • You are asked to generate some randomness by moving the mouse on the area below the progress bar:
PuTTYgen2.png

  • When done the public key is shown and the Save buttons are enabled:
PuTTYgen3.png
Changed:
<
<
  • Optionally you can enter a passphrase to protect your private key. Leave fields blank if you do not want.
>
>
  • Optionally you can enter a passphrase to protect your private key, please do so!
 
  • Click on "Save private key":
PuTTYgen5.png

  • Enter a name and select a destination folder, then click "Save". IMPORTANT: This file MUST reside on your computer and it cannot leave it or be sent over any network.
  • Do likewise for the public key (click on "Save public key").
  • Now go back to the PuTTYgen main screen and select the public key with the mouse, right click on the selection and copy it.
  • Open a new PuTTY session to the Linux machine you want to connect via those SSH keys.
  • At prompt, cd to .ssh/ folder:
authkey1.png

  • With a text editor of your choice, open the authorized_keys file. If not existing, an empty one will be created:
authkey2.png

  • Go to the end of file and paste the public key as a new line (middle or right mouse buttons click when in text editing mode):
authkey3.png

  • Save, exit and close the PuTTY session. Now you need to tell PuTTY to use the new key pair.
  • Go back to the PuTTY main window, load your saved session settings from the Session tab.
  • Go to Connection -> SSH -> Auth and click on "Browse":
PuTTYgen6.png

  • Select the private key file you saved previously and click "OK".
  • Go back to the Session screen, and save the new session settings for future use.
  • You are done! Try to connect: you should go straight to the shell prompt with no password request.

Possible issues

If you are still prompted for a password, try the following:

  • Make sure you did not miss any character in the copy/paste of the public key. If not sure, copy it again from the saved public key file and re-do the paste.
  • Check the authorized_keys permissions if creating a new file. They must be 644 (see the chmod man page).
  • Make sure your private key is loaded into the PuTTY session.

-- Federico Melaccio - 2014-07-11

Deleted:
<
<
 
META FILEATTACHMENT attachment="PuTTYgen1.png" attr="" comment="" date="1405078916" name="PuTTYgen1.png" path="PuTTYgen1.png" size="30592" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="PuTTYgen2.png" attr="" comment="" date="1405078930" name="PuTTYgen2.png" path="PuTTYgen2.png" size="34305" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="PuTTYgen3.png" attr="" comment="" date="1405078936" name="PuTTYgen3.png" path="PuTTYgen3.png" size="41091" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="PuTTYgen4.png" attr="" comment="" date="1405078943" name="PuTTYgen4.png" path="PuTTYgen4.png" size="42875" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="PuTTYgen5.png" attr="" comment="" date="1405078949" name="PuTTYgen5.png" path="PuTTYgen5.png" size="103268" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="PuTTYgen6.png" attr="" comment="" date="1405078957" name="PuTTYgen6.png" path="PuTTYgen6.png" size="36464" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="authkey1.png" attr="" comment="" date="1405078964" name="authkey1.png" path="authkey1.png" size="47049" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="authkey2.png" attr="" comment="" date="1405078969" name="authkey2.png" path="authkey2.png" size="50819" user="FedericoMelaccio" version="1"
META FILEATTACHMENT attachment="authkey3.png" attr="" comment="" date="1405078973" name="authkey3.png" path="authkey3.png" size="41218" user="FedericoMelaccio" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback