Thursday, November 17, 2011

SSH with Private/Public Key Pairs

I started experimenting with Amazon EC2 recently, and was finally forced to use the private/public key authentication method with SSH. Like most folks, I have always used the standard way of logging in to SSH with a username/password pair. EC2 doesn't give you that option, so I had to figure out how to configure Putty to do this. 

I tried it on my own first because it seemed like it should be simple enough. I perused the category options in the left pane and determined that SSH>Auth must be where to indicate the private key I was using. I set this up using the key I downloaded from Amazon and was not able to connect. Turns out I missed a pretty simple step. 

According to http://www.howtoforge.com I was missing the part where I convert the key Amazon gave me to one that Putty can actually understand. I downloaded and ran PuttyGen, which allowed me to load the key and then save it in a Putty format. That made everything else work as expected. 

Now I have to work on figuring out what version of Linux Amazon has set me up with in my Micro Instance. It looks like a RHEL-variant based on the fact that the version info is in /etc/system-release and not /etc/lsb-release as I'm used to, but cat'ing that file shows "Amazon Linux AMI release 2011.09". I also tested my package installers and it's definitely using yum and not apt-get. I suppose technically that's all the info I need to know, but I'm a curious one. I want to know how Amazon's changed it so that it's "theirs". 

No comments:

Post a Comment