Difference between revisions of "Using PuTTY with SSH Key Pair"

From CipherSpace Client Wiki
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|400px|border]]
#:[[File:PuTTY_Gen_1.png|500px|border]]
#:<br />
# Under &quot;Parameters&quot;, for &quot;Type of key to generate:&quot; select RSA and in the field &quot;Number of bits in a generated key:&quot; put the value '4096'
# Under &quot;Parameters&quot;, for &quot;Type of key to generate:&quot; select RSA and in the field &quot;Number of bits in a generated key:&quot; put the value '4096'
#:[[File:PuTTY_Gen_2.png|400px|border]]
#:[[File:PuTTY_Gen_2.png|500px|border]]
#:<br />
# Under &quot;Actions&quot;, click on &quot;Generate&quot;,
# Under &quot;Actions&quot;, click on &quot;Generate&quot;,
#:[[File:PuTTY_Gen_3.png|400px|border]]
#:[[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|400px|border]]
#:[[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|400px|border]]
#:[[File:PuTTY_Gen_5.png|500px|border]]
#:<br />
# Add a key passphrase in the fields &quot;Key passphrase:&quot; and &quot;Confirm passphrase:&quot;.
# Add a key passphrase in the fields &quot;Key passphrase:&quot; and &quot;Confirm passphrase:&quot;.
#:[[File:PuTTY_Gen_6.png|400px|border]]
#:[[File:PuTTY_Gen_6.png|500px|border]]
#:<br />
# Click on &quot;Save private key&quot; and give it the name &quot;CipherSpace&quot;
# Click on &quot;Save private key&quot; and give it the name &quot;CipherSpace&quot;
#:[[File:PuTTY_Gen_7.png|400px|border]]
#:[[File:PuTTY_Gen_7.png|500px|border]]
#:<br />
# Click on &quot;Save public key&quot; and give it the name &quot;CipherSpace.pub&quot;.
# Click on &quot;Save public key&quot; and give it the name &quot;CipherSpace.pub&quot;.
#:[[File:PuTTY_Gen_8.png|400px|border]]
#:[[File:PuTTY_Gen_8.png|500px|border]]
#:<br />
# Send the public key (&quot;CipherSpace.pub&quot;) to CipherSpace in order to be included in your environment.
# Send the public key (&quot;CipherSpace.pub&quot;) to CipherSpace in order to be included in your environment.


Line 37: Line 45:


# Start the program &quot;PuTTY&quot;
# Start the program &quot;PuTTY&quot;
#:[[File:PuTTY_Conf_1.png|400px|border]]
#:[[File:PuTTY_Conf_1.png|500px|border]]
#:<br />
# Go to &quot;Session&quot; and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is &quot;SSH&quot;.
# Go to &quot;Session&quot; and enter the host name (or IP address) and the port of the machine you want to reach. The connection type is &quot;SSH&quot;.
#:[[File:PuTTY_Conf_2.png|400px|border]]
#:[[File:PuTTY_Conf_2.png|500px|border]]
#:<br />
# Optional: Go to &quot;Connection -&gt; Data&quot; and enter the username for the machine you want to connect with.
# Optional: Go to &quot;Connection -&gt; Data&quot; and enter the username for the machine you want to connect with.
#:[[File:PuTTY_Conf_3.png|400px|border]]
#:[[File:PuTTY_Conf_3.png|500px|border]]
#:<br />
# Go to &quot;Connection -&gt; SSH -&gt; Auth&quot;, then next to the field &quot;Private key file for authentication:&quot; click on the button &quot;Browse...&quot;
# Go to &quot;Connection -&gt; SSH -&gt; Auth&quot;, then next to the field &quot;Private key file for authentication:&quot; click on the button &quot;Browse...&quot;
#:[[File:PuTTY_Conf_4.png|400px|border]]
#:[[File:PuTTY_Conf_4.png|500px|border]]
#:<br />
#:and select the private key &quot;CipherSpace.ppk&quot;.
#:and select the private key &quot;CipherSpace.ppk&quot;.
#:[[File:PuTTY_Conf_5.png|400px|border]]#
#:[[File:PuTTY_Conf_5.png|500px|border]]
#:<br />
# Go back to &quot;Session&quot;, then under the field &quot;Saved Sessions&quot; enter a name (for instance &quot;CipherSpace VM1&quot;) and click on &quot;Save&quot;.
# Go back to &quot;Session&quot;, then under the field &quot;Saved Sessions&quot; enter a name (for instance &quot;CipherSpace VM1&quot;) and click on &quot;Save&quot;.
#:[[File:PuTTY_Conf_6.png|400px|border]]#
#:[[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 &quot;PuTTY&quot;
# Start the program &quot;PuTTY&quot;
#:[[File:PuTTY_Run_1.png|400px|border]]
#:[[File:PuTTY_Run_1.png|500px|border]]
#:<br />
# Go to &quot;Session&quot;, then under the field &quot;Saved Sessions&quot; select the session you've created previously and click on &quot;Load&quot;
# Go to &quot;Session&quot;, then under the field &quot;Saved Sessions&quot; select the session you've created previously and click on &quot;Load&quot;
#:[[File:PuTTY_Run_2.png|400px|border]]
#:[[File:PuTTY_Run_2.png|500px|border]]
#:<br />
# Click on &quot;Open&quot;
# Click on &quot;Open&quot;
#:[[File:PuTTY_Run_3.png|400px|border]]
#:[[File:PuTTY_Run_3.png|500px|border]]
#:<br />
# If you get the error &quot;Network error: Connection refused&quot;,
# If you get the error &quot;Network error: Connection refused&quot;,
#:[[File:PuTTY_Run_4.png|400px|border]]
#:[[File:PuTTY_Run_4.png|300px|border]]
#:<br />
#:close the window, restart PuTTY and under &quot;Session&quot; check that the hostname and the port are correct.
#:close the window, restart PuTTY and under &quot;Session&quot; 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|400px|border]]
#:[[File:PuTTY_Run_5.png|500px|border]]
#:<br />
#:Click on &quot;Yes&quot; to avoid the warning for the next sessions.
#:Click on &quot;Yes&quot; to avoid the warning for the next sessions.
# If you get the error &quot;Disconnected: No supported authentication methods available (server sent: publickey)&quot;,
# If you get the error &quot;Disconnected: No supported authentication methods available (server sent: publickey)&quot;,
#:[[File:PuTTY_Run_6.png|400px|border]]
#:[[File:PuTTY_Run_6.png|500px|border]]
#:<br />
#:it means you have forgotten to add your private key under &quot;Connection -&gt; SSH -&gt; Auth&quot; (see the point 4. in [[#Create a PuTTY session|this section]])
#:it means you have forgotten to add your private key under &quot;Connection -&gt; SSH -&gt; Auth&quot; (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

  1. Go to this site and download the MSI (Windows Installer) package for your architecture (32 or 64 bit).
  2. Run the installer and accept all the default values. You will need administrator rights to install the package.

Create a SSH Key Pair

  1. Start the program "PuTTYgen" (which was installed with PuTTY previously).
    PuTTY Gen 1.png

  2. 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'
    PuTTY Gen 2.png

  3. Under "Actions", click on "Generate",
    PuTTY Gen 3.png

    then move the mouse on the blank area until the green bar is filled.
    PuTTY Gen 4.png

    You should get a similar screen:
    PuTTY Gen 5.png

  4. Add a key passphrase in the fields "Key passphrase:" and "Confirm passphrase:".
    PuTTY Gen 6.png

  5. Click on "Save private key" and give it the name "CipherSpace"
    PuTTY Gen 7.png

  6. Click on "Save public key" and give it the name "CipherSpace.pub".
    PuTTY Gen 8.png

  7. 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.

  1. Start the program "PuTTY"
    PuTTY Conf 1.png

  2. 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".
    PuTTY Conf 2.png

  3. Optional: Go to "Connection -> Data" and enter the username for the machine you want to connect with.
    PuTTY Conf 3.png

  4. Go to "Connection -> SSH -> Auth", then next to the field "Private key file for authentication:" click on the button "Browse..."
    PuTTY Conf 4.png

    and select the private key "CipherSpace.ppk".
    PuTTY Conf 5.png

  5. Go back to "Session", then under the field "Saved Sessions" enter a name (for instance "CipherSpace VM1") and click on "Save".
    PuTTY Conf 6.png

    You'll be able to load this configuration for a new session.

Connect with PuTTY

  1. Start the program "PuTTY"
    PuTTY Run 1.png

  2. Go to "Session", then under the field "Saved Sessions" select the session you've created previously and click on "Load"
    PuTTY Run 2.png

  3. Click on "Open"
    PuTTY Run 3.png

  4. If you get the error "Network error: Connection refused",
    PuTTY Run 4.png

    close the window, restart PuTTY and under "Session" check that the hostname and the port are correct.
  5. The first time you connect to a machine, you will get the following warning:
    PuTTY Run 5.png

    Click on "Yes" to avoid the warning for the next sessions.
  6. If you get the error "Disconnected: No supported authentication methods available (server sent: publickey)",
    PuTTY Run 6.png

    it means you have forgotten to add your private key under "Connection -> SSH -> Auth" (see the point 4. in this section)