The following instructions explain how to connect to your Linux instance using PuTTY, a free SSH client for Windows. It is assumed that the EC2 instance is already running.
PuTTY
Downlad and install PuTTY.
PuTTY does not natively support the private key format (.pem) generated by Amazon EC2. PuTTY has a tool named PuTTYgen, which can convert keys to the required PuTTY format (.ppk). You must convert your private key into this format (.ppk) before attempting to connect to your instance using PuTTY.
- Start PuTTYgen.
- Under Type of key to generate, select SSH-2 RSA.
- Choose 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.
- Select your
.pem
file for the key pair that you specified when you launch your instance, and then choose Open. Choose OK to dismiss the confirmation dialog box. - Choose Save private key to save the key in the format that PuTTY can use. PuTTYgen displays a warning about saving the key without a passphrase. Choose Yes.
- Specify the same name for the key that you used for the key pair (for example,
my-key-pair
). PuTTY automatically adds the.ppk
file extension. - Your private key is now in the correct format for use with PuTTY. You can now connect to your instance using PuTTY’s SSH client.
Starting a PuTTY Session
- Start PuTTY
- In the Category pane, select Session. In the Host Name box, enter
user_name
@public_dns_name
. Be sure to specify the appropriate user name for your AMI. For example:- For an Amazon Linux AMI, the user name is
ec2-user
. - For a RHEL AMI, the user name is
ec2-user
orroot
. - For an Ubuntu AMI, the user name is
ubuntu
orroot
. - For a Centos AMI, the user name is
centos
. - For a Fedora AMI, the user name is
ec2-user
. - For SUSE, the user name is
ec2-user
orroot
. - Otherwise, if
ec2-user
androot
don’t work, check with the AMI provider.
- For an Amazon Linux AMI, the user name is
- Under Connection type, select SSH.
- Ensure that Port is 22
- In the Category pane, expand Connection, expand SSH, and then select Auth.
- Select the
.ppk
file that you generated for your key pair, and then choose Open. - (Optional) If you plan to start this session again later, you can save the session information for future use. Select Session in the Category tree, enter a name for the session in Saved Sessions, and then choose Save.
- Choose Open to start the PuTTY session.
- If this is the first time you have connected to this instance, PuTTY displays a security alert dialog box that asks whether you trust the host you are connecting to.
- Choose Yes. A window opens and you are connected to your instance.
0 Comments Leave a comment
Comments are closed.