Connecting to a Linux EC2 Instance over SSH
So you've created a Linux EC2 instance in Amazon Web Services, with a key-pair, and now you need to connect to it over SSH. For this we'll need:
- A copy of the PuTTY and PuTTYgen programs, downloaded from the internet.
- Your key file that was generated when you created the instance.
- Your instance's IP address, which you can get from the Amazon EC2 page.
Downloading PuTTY and PuTTYgen
PuTTY is a free Telnet and SSH client which we will use to connect to our Linux instance.
PuTTYgen is a tool which will convert our key-file into a form suitable for PuTTY.
The tools are in beta, but they have been for years, like Google products. They're stable.
Download PuTTY and PuTTYgen from the PuTTY download page by clicking each EXE.
Save them to your local hard-drive wherever is easily accessible: no installation required!
Converting your .PEM key-file to .PPK
To connect to your instance using PuTTY you need a private key file (ending in .ppk).
We'll use PuTTYgen to convert our Amazon key-file (ending in .pem) to that format.
Click the PuTTYgen binary to start the conversion program:
Ensure that SSH-2-RSA is selected as the type, then click Load.
Pick the .pem key-file from Amazon (choose All Files in the file-type drop-down).
Then click Open to load the key:
Once the key is loaded, it can be saved in .ppk format.
You can add a passphrase if you are happy to type that every time you connect.
Then create the private key file in a memorable location by clicking Save private key.
Now close the PuTTYgen application.
Connecting using PuTTY
Open the PuTTY application by clicking it.
In the Host Name box enter ec2-user@ followed by the IP address for your AWS instance.
Then expand the SSH node (under Connection in the left hand side-bar) and expand Auth.
Click Browse and select the private key (.ppk) file that you saved earlier.
Then click Open to connect to your Amazon instance.
And we're done.






No comments:
Post a Comment