How to use SSH keys to log into NearlyFreeSpeech

NFS allows you to use keys to log into your SSH sessions. This is much easier and more secure than remembering a password. You can set this up really easily by doing the following…

First we need to generate a SSH key. Let’s use the putty keygen tool to do that. You can download it here: http://winscp.net/eng/docs/ui_puttygen
Run the program and select ‘SSH-2 RSA’ and a key length of 2048, this will comply with NFS’s key requirements then click Generate. You’ll need to move your mouse around the screen for a little bit to generate entropy to seed the key.

puttykeygen

You can add a comment to help ID your key later and not get it mixed up with any others you use.

While we’re in this window you should use the save buttons to save your public and private keys locally on your computer. The private key you saved will be used later in your SSH program. Next copy your public key from the key generator window – just select it and Ctrl-C.

Now in NFS, open your Account Profile and click ‘Add SSH Key’ on the right. Then paste in the key you copied in the box which appears on the next screen. That is NFS all set up.

nfs_addsshkey

 

In your SSH program (we’ll use putty as an example since it is the most popular but I use MobaXterm since I like it’s interface and config options better) you need to add the SSH details for your site from NFS. Add the NFS SSH address (ssh.phx.nearlyfreespeech.net) to the ‘Session’ screen, then go to the “Data” configuration inside the “Connection” heading in the left-hand navigation menu:

puttymenu

Here, we will enter our server’s username – for NFS this is usually your account name and your site name – this will be in the site details tab of the NFS config screens.

putty_name

Then point the SSH program to your private key which you saved earlier. In putty you do this in the “SSH” category in the navigation menu

putty_sshmenu

In the Auth submenu there is a field to browse to the private key file so point putty to your saved file from earlier.

putty_authmenu

Go back to the ‘Session’ screen and give your session a name then hit save. Now every time you connect through the saved session in putty, you’ll not be prompted for your username and password.

 

 

 

 

Leave a Reply

(email optional)