Logging in with a SSH Private Key on Windows


Introduction

In this example, we’re going to demonstrate how to load a private key into PuTTY. You’ll need two pieces of software to complete this task:

  1. PuTTY – Client to for managing SSH sessions
  2. PuTTYgen – Tool for managing and creating SSH key pairs

Both tools can be downloaded here:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

PuTTYgen: Loading the Key

As a part of a Rackspace Deployment, you may be provided a SSH Private Key to be used for authentication against your newly deployed Linux servers. The first thing to do is save this private key into a file. Here’s an example key:

You will need everything you see in the example above to be included in your key file.

Now launch PuTTYgen:

Click load and change the file type to search for to All Files:

Select the key you saved to a text file earlier and click Open:

Now PuTTYgen will confirm that your key has been loaded:

You now have the option to create a Key passphrase. This passphrase is optional. If you provide one, you will be prompted for that passphrase whenever you login to a server with this key. In this example, we’re going to save the private key without a password:

After clicking Yes, select the path to save this PuTTY Private Key File to and click Save:

PuTTY: Logging in with the Private Key

Setup your session in PuTTy. You can name the session anything you would like. In this case, we are naming the session based on the IP of the server we are connecting to, and click save:

Now click on Connection >Data and set the Auto-login username to root:

Click on Auth and configure the Private Key to use by clicking Browse under Private key file for authentication:

Navigate to the location where you saved your private key earlier, select the file, and click Open:

Now you’ll see the private key path listed:

Navigate back to Session and save this session information one more time.

Now click Open to begin your session with the server. If you saved you key with a passphrase, you will be prompted to enter that passphrase. You will be given an alert that the server’s host is not cached. Click Yes at this point to continue the connection.

Now you will be in logged into your server:



Was this content helpful?




© 2014 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER