Connecting to Your Linux Instance from Windows Using PuTTY

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.

  1. Start PuTTYgen.
  2. Under Type of key to generate, select SSH-2 RSA.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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

  1. Start PuTTY
  2. In the Category pane, select SessionIn the Host Name box, enter user_name@public_dns_name. Be sure to specify the appropriate user name for your AMI. For example:
    1. For an Amazon Linux AMI, the user name is ec2-user.
    2. For a RHEL AMI, the user name is ec2-user or root.
    3. For an Ubuntu AMI, the user name is ubuntu or root.
    4. For a Centos AMI, the user name is centos.
    5. For a Fedora AMI, the user name is ec2-user.
    6. For SUSE, the user name is ec2-user or root.
    7. Otherwise, if ec2-user and root don’t work, check with the AMI provider.
  3. Under Connection type, select SSH.
  4. Ensure that Port is 22
  5. In the Category pane, expand Connection, expand SSH, and then select Auth.
  6. Select the .ppk file that you generated for your key pair, and then choose Open.
  7. (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.
  8. Choose Open to start the PuTTY session.
  9. 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.
  10. Choose Yes. A window opens and you are connected to your instance.

Source

Comments are closed.