Difference between revisions of "Using PuTTY with SSH Key Pair"
Jump to navigation
Jump to search
(Created page with "Category:PuTTY Category:How To Category:CloudInfrastructure == PuTTY == PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows p...") |
|||
Line 15: | Line 15: | ||
# Start the program "PuTTYgen" (which was installed with PuTTY previously). | # Start the program "PuTTYgen" (which was installed with PuTTY previously). | ||
#:[[File:PuTTY_Gen_1.png| | #:[[File:PuTTY_Gen_1.png|500px|border]] | ||
#:<br /> | |||
# Under "Parameters", for "Type of key to generate:" select RSA and in the field "Number of bits in a generated key:" put the value '4096' | # Under "Parameters", for "Type of key to generate:" select RSA and in the field "Number of bits in a generated key:" put the value '4096' | ||
#:[[File:PuTTY_Gen_2.png| | #:[[File:PuTTY_Gen_2.png|500px|border]] | ||
#:<br /> | |||
# Under "Actions", click on "Generate", | # Under "Actions", click on "Generate", | ||
#:[[File:PuTTY_Gen_3.png| | #:[[File:PuTTY_Gen_3.png|500px|border]] | ||
#:<br /> | |||
#:then move the mouse on the blank area until the green bar is filled. | #:then move the mouse on the blank area until the green bar is filled. | ||
#:[[File:PuTTY_Gen_4.png| | #:[[File:PuTTY_Gen_4.png|500px|border]] | ||
#:<br /> | |||
#:You should get a similar screen: | #:You should get a similar screen: | ||
#:[[File:PuTTY_Gen_5.png| | #:[[File:PuTTY_Gen_5.png|500px|border]] | ||
#:<br /> | |||
# Add a key passphrase in the fields "Key passphrase:" and "Confirm passphrase:". | # Add a key passphrase in the fields "Key passphrase:" and "Confirm passphrase:". | ||
#:[[File:PuTTY_Gen_6.png| | #:[[File:PuTTY_Gen_6.png|500px|border]] | ||
#:<br /> | |||
# Click on "Save private key" and give it the name "CipherSpace" | # Click on "Save private key" and give it the name "CipherSpace" | ||
#:[[File:PuTTY_Gen_7.png| | #:[[File:PuTTY_Gen_7.png|500px|border]] | ||
#:<br /> | |||
# Click on "Save public key" and give it the name "CipherSpace.pub". | # Click on "Save public key" and give it the name "CipherSpace.pub". | ||
#:[[File:PuTTY_Gen_8.png| | #:[[File:PuTTY_Gen_8.png|500px|border]] | ||
#:<br /> | |||
# Send the public key ("CipherSpace.pub") to CipherSpace in order to be included in your environment. | # Send the public key ("CipherSpace.pub") to CipherSpace in order to be included in your environment. | ||
Line 37: | Line 45: | ||
# Start the program "PuTTY" | # Start the program "PuTTY" | ||
#:[[File:PuTTY_Conf_1.png| | #:[[File:PuTTY_Conf_1.png|500px|border]] | ||
#:<br /> | |||
# Go to "Session" and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is "SSH". | # Go to "Session" and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is "SSH". | ||
#:[[File:PuTTY_Conf_2.png| | #:[[File:PuTTY_Conf_2.png|500px|border]] | ||
#:<br /> | |||
# Optional: Go to "Connection -> Data" and enter the username for the machine you want to connect with. | # Optional: Go to "Connection -> Data" and enter the username for the machine you want to connect with. | ||
#:[[File:PuTTY_Conf_3.png| | #:[[File:PuTTY_Conf_3.png|500px|border]] | ||
#:<br /> | |||
# Go to "Connection -> SSH -> Auth", then next to the field "Private key file for authentication:" click on the button "Browse..." | # Go to "Connection -> SSH -> Auth", then next to the field "Private key file for authentication:" click on the button "Browse..." | ||
#:[[File:PuTTY_Conf_4.png| | #:[[File:PuTTY_Conf_4.png|500px|border]] | ||
#:<br /> | |||
#:and select the private key "CipherSpace.ppk". | #:and select the private key "CipherSpace.ppk". | ||
#:[[File:PuTTY_Conf_5.png| | #:[[File:PuTTY_Conf_5.png|500px|border]] | ||
#:<br /> | |||
# Go back to "Session", then under the field "Saved Sessions" enter a name (for instance "CipherSpace VM1") and click on "Save". | # Go back to "Session", then under the field "Saved Sessions" enter a name (for instance "CipherSpace VM1") and click on "Save". | ||
#:[[File:PuTTY_Conf_6.png| | #:[[File:PuTTY_Conf_6.png|500px|border]] | ||
#:<br /> | |||
#:You'll be able to load this configuration for a new session. | #:You'll be able to load this configuration for a new session. | ||
Line 53: | Line 67: | ||
# Start the program "PuTTY" | # Start the program "PuTTY" | ||
#:[[File:PuTTY_Run_1.png| | #:[[File:PuTTY_Run_1.png|500px|border]] | ||
#:<br /> | |||
# Go to "Session", then under the field "Saved Sessions" select the session you've created previously and click on "Load" | # Go to "Session", then under the field "Saved Sessions" select the session you've created previously and click on "Load" | ||
#:[[File:PuTTY_Run_2.png| | #:[[File:PuTTY_Run_2.png|500px|border]] | ||
#:<br /> | |||
# Click on "Open" | # Click on "Open" | ||
#:[[File:PuTTY_Run_3.png| | #:[[File:PuTTY_Run_3.png|500px|border]] | ||
#:<br /> | |||
# If you get the error "Network error: Connection refused", | # If you get the error "Network error: Connection refused", | ||
#:[[File:PuTTY_Run_4.png| | #:[[File:PuTTY_Run_4.png|300px|border]] | ||
#:<br /> | |||
#:close the window, restart PuTTY and under "Session" check that the hostname and the port are correct. | #:close the window, restart PuTTY and under "Session" check that the hostname and the port are correct. | ||
# The first time you connect to a machine, you will get the following warning: | # The first time you connect to a machine, you will get the following warning: | ||
#:[[File:PuTTY_Run_5.png| | #:[[File:PuTTY_Run_5.png|500px|border]] | ||
#:<br /> | |||
#:Click on "Yes" to avoid the warning for the next sessions. | #:Click on "Yes" to avoid the warning for the next sessions. | ||
# If you get the error "Disconnected: No supported authentication methods available (server sent: publickey)", | # If you get the error "Disconnected: No supported authentication methods available (server sent: publickey)", | ||
#:[[File:PuTTY_Run_6.png| | #:[[File:PuTTY_Run_6.png|500px|border]] | ||
#:<br /> | |||
#:it means you have forgotten to add your private key under "Connection -> SSH -> Auth" (see the point 4. in [[#Create a PuTTY session|this section]]) | #:it means you have forgotten to add your private key under "Connection -> SSH -> Auth" (see the point 4. in [[#Create a PuTTY session|this section]]) |
Revision as of 15:25, 17 August 2017
PuTTY
PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available with source code and is developed and supported by a group of volunteers.
Install PuTTY
- Go to this site and download the MSI (Windows Installer) package for your architecture (32 or 64 bit).
- Run the installer and accept all the default values. You will need administrator rights to install the package.
Create a SSH Key Pair
- Start the program "PuTTYgen" (which was installed with PuTTY previously).
- Under "Parameters", for "Type of key to generate:" select RSA and in the field "Number of bits in a generated key:" put the value '4096'
- Under "Actions", click on "Generate",
- Add a key passphrase in the fields "Key passphrase:" and "Confirm passphrase:".
- Click on "Save private key" and give it the name "CipherSpace"
- Click on "Save public key" and give it the name "CipherSpace.pub".
- Send the public key ("CipherSpace.pub") to CipherSpace in order to be included in your environment.
Create a PuTTY session
In order to connect to a machine via PuTTY for the first time, you need to create a session.
- Start the program "PuTTY"
- Go to "Session" and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is "SSH".
- Optional: Go to "Connection -> Data" and enter the username for the machine you want to connect with.
- Go to "Connection -> SSH -> Auth", then next to the field "Private key file for authentication:" click on the button "Browse..."
- Go back to "Session", then under the field "Saved Sessions" enter a name (for instance "CipherSpace VM1") and click on "Save".
Connect with PuTTY
- Start the program "PuTTY"
- Go to "Session", then under the field "Saved Sessions" select the session you've created previously and click on "Load"
- Click on "Open"
- If you get the error "Network error: Connection refused",
- The first time you connect to a machine, you will get the following warning:
- If you get the error "Disconnected: No supported authentication methods available (server sent: publickey)",
- it means you have forgotten to add your private key under "Connection -> SSH -> Auth" (see the point 4. in this section)