PuTTY does not natively support the private key format (.pem) generated by Amazon EC2. If you load the .pem formet private key directly to PuTTY you will get error message: Unable to use key file “***.pem” (OpenSSH SSH-2 private key). PuTTY has a tool called PuTTYgen, which can convert keys to the required PuTTY format (.ppk). You must convert your private key into this format (.ppk) before connecting to your instance using PuTTY.
.pem file for the key pair that you specified when you launched the instance.
Your default security group does not allow incoming SSH traffic. authorize Inbound Traffic for Your Amazon EC2 Linux Instances
Get the public DNS name of the instance or the Public IP address.
Converting Your Private Key Using PuTTYgen.
- Download the latest version PuTTYgen
- Start puttygen.exe
- Under Type of key to generate, select SSH-2 RSA
- Load your .pem file. Click Load. By default, PuTTYgen displays only files with the extension .ppk. To locate your .pem file, select the option to display files of all types.
- Click Save private key to save the key in the format that PuTTY can use. Note: You can use a passphrase to add an extra layer of protection to the private key.
- Fill in the public DNS name of the instance or the Public IP address.
- In the Category pane, expand Connection, expand SSH, and then select Auth.
- Browse and select the .ppk file that you generated for your key pair, and then click Open.
- login in as: ec2-user or ubuntu depends on the system that you selected for the instance. You can try to login as root first and find out what login name should you use.