SSH Shared Keys - Goodbye boring passwords :)  

Posted by John Clarke, Business Partner, jc-Interactive

Today, while doing some multi-connections to vairous servers, it began to become quite tiring having to go to my credentials file, copying and pasting the usernames and passwords the wholetime... So, I did the following, and you too can benefit from this :) (Please note: I am using Ubuntu 9.10 Karmic Koala, so check your documentation before just using all of this verbatim on your distro... and yes, this tut [according to my knowledge] applies to linux, sorry windoze users :)) First, lets open a terminal and go the your home folder :) You should have something like the following:

MasterChief@Sparta:~$
From here, do the following commands in sequence:
ssh-keygen -t rsa1
This creates your key pair in SSH1 format (just in case you will need to connect to a older machine ;)) The tool will respond with something to the like of:

Generating public/private rsa1 key pair. Enter file in which to save the key (/home/MasterChief/.ssh/identity):

I normally stick to defaults, why complicate things. Next it will prompt you for a passphrase. You don't need to enter one, but I advise for it though as it helps in making sure someone doesn't accidentally stumble onto you system and have full access to your servers. Once this is done, it will show:

Your identification has been saved in /home/MasterChief/.ssh/identity. Your public key has been saved in /home/MasterChief/.ssh/identity.pub.

This just basically says that your keys have been generated and where they are located :) So, let's make a keypair for SSH2 connections... You can use the same passphrases if you wish, your choice :)
ssh-keygen -t dsa
Then...
ssh-keygen -t rsa
So, now you should have three sets of keyparis within your ~/.ssh directory. The ones with the .pub extensions are your public keypairs, these will be used on your server while t [...]

Later! [url="http://www.john-clarke.co.za"]John Clarke[url]

This entry was posted on Thursday, November 19, 2009 at 2:08 PM . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment