Log in to a Linux server with an SSH private key on a Windows client
This article demonstrates how to load an SSH private key into PuTTY in order to connect to a Linux® server. You need the following software to complete this task:
- PuTTY: A client for managing SSH sessions
- PuTTYgen: A tool for managing and creating SSH key pairs
To download both tools, see Download PuTTY: latest release.
Save your private SSH key to a text file
As a part of your deployment Infofractal provides the private key in your control panel.
Open a text editor, paste your SSH private key, and save the file.
Your SSH private key should look similar to the key in the following image:
You need to include all of the text that appears in the image in your key file.
Load your SSH private key in PuTTY Key Generator
Use the following steps to load your SSH private key in PuTTY Key Generator:
-
Launch PuTTY Key Generator.
-
In the Actions section, click Load to load an existing private key file. Change the file type to search for to All Files.
-
Select the key that you saved to a text file earlier and click Open.
A confirmation displays after PuTTYgen successfully imports the private key. Click OK to dismiss the message.
-
Click Save private key, then enter a file name in the Save private key as dialog box to save it for use with PuTTY.
Note: We strongly recommend that you keep the default settings.
Log in to PuTTY by using your SSH private key
Use the following steps to log in to PuTTY by using your SSH private key:
-
Enter a name for the session and click Save.
Note: You can use any name that you want. This example names the session based on the Internet Protocol (IP) address of the server to which the user is connecting.
-
Click Connection > Data in the left navigation pane and set the Auto-login username to centos, ubuntu, debian, etc, depending on your VPS Linux distribution.
-
Click Connection > SSH > Auth in the left navigation pane and configure the SSH private key to use by clicking Browse under Private key file for authentication.
-
Navigate to the location where you saved your SSH private key file, select the file, and click Open.
The file path for the SSH private key file now displays in the Private key file for authentication field.
-
Click Session in the left navigation pane, then click Save in the Load, save or delete a stored session section.
-
Click Open to begin your session with the server.
If you saved your SSH private key with a passphrase, you’re prompted to enter that passphrase. An alert displays indicating that the server’s host is not cached. Click Yes to continue the connection.