Connect to AWS EC2 Linux instance using Putty

 Author: Shengtao Zhou       Created: 4/9/2019 5:35:46 AM       Modified: 4/9/2019 10:29:50 PM   More...
This shows how to connect to an EC2 Linux instance from Windows 10.

Putty download page:

Connect to EC2 using Putty:

The instruction above misses some steps. It's better to following the following steps:

1. First find the .pem key file that you used to launch the EC2 instance.

2. Generate private key (.ppk) from .pem key pair file using PuTTYGen

Open PuTTYGen, load the .pem key file, enter a passphase (password) twice, click "Save private key" button to save it as private key.

3. Set permission for .pem key

You locate the file in Windows Explorer, right-click on it then select "Properties". Navigate to the "Security" tab and click "Advanced".

Change the owner to you, disable inheritance and delete all permissions. Then grant yourself "Full control" and save the permissions. Now SSH won't complain about file permission too open anymore.

4. Test using SSH using windows command line

The reason to test SSH in command line is it gives you useful error message if there's something wrong, PuTTY shows little information when things goes wrong.

In AWS, right click the EC2 instance and click "Connect", it will show a SSH command string of how to connect. Like this,
ssh -i "KeyPairX.pem" <user name>@<Your DNS Name>
Then open a command window. Change the current directory to the location saving your .pem file using "cd" command.
Run the ssh command line (as above), you should be able to connect the server now.

5. User PuTTY to connect the EC2 instance

Start puTTY, enter the host name as <user name>@<Your DNS Name> from step 3. (To be noticed, the AWS instruction said the user name is ec2-user for linux, but it's not always true, so you need to follow this)
In the Catetory tree, select Connection->SSH->Auth, then Browser the .ppk key file. Then click "Open", it will ask you for the passphase for the key file. You should be able to connect.

More...          Back to List          

(Please enter you comments between 100 to 2000 characters. Thanks for your contribution.) 

         Created:       Modified: 

Editing a comment

       (Please enter you comments between 100 to 2000 characters. Please login before edit comment.)