0%

Connect to newly created AWS Linux instance from Windows

This post is referenced from Connect to your Linux instance from Windows using PuTTY

Aws only provide one way to connect to Linux defaultly, it is through SSH by certificate, but the aws generated certificate is in OpenSSH format(in pem format), which is not supported by commonly used SSH client Putty(in ppk format). So we need to use PuttyGen to convert the certificate to PEM format.

Download Putty

You need to download the Putty MSI installer and install it.

Covert the certificate

You can generate the certificate by using the following steps:

  1. From the Start menu, choose All Programs, PuTTY, PuTTYgen.

  2. Under Type of key to generate, choose RSA. If your version of PuTTYgen does not include this option, choose SSH-2 RSA.

  3. Choose Load. By default, PuTTYgen displays only files with the extension .ppk. To locate your .pem file, choose the option to display files of all types.

  4. Select your .pem file for the key pair that you specified when you launched your instance and choose Open. PuTTYgen displays a notice that the .pem file was successfully imported. Choose OK.

  5. To save the key in the format that PuTTY can use, choose Save private key. 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) and choose Save. PuTTY automatically adds the .ppk file extension.

Connect to the instance

You can connect to the instance by using the following steps:

  1. From the Start menu, choose All Programs, PuTTY, PuTTY.

  2. In the Category pane, choose Session and complete the following fields:

    • In the Host Name box, do one of the following:

      (Public DNS) To connect using your instance’s public DNS name, enter my-instance-user-name@my-instance-public-dns-name.

      (IPv6) Alternatively, if your instance has an IPv6 address, to connect using your instance’s IPv6 address, enter my-instance-user-name@my-instance-IPv6-address.

    • For information about how to get the user name for your instance, and the public DNS name or IPv6 address of your instance, see Get information about your instance.

    • Ensure that the Port value is 22.

    • Under Connection type, select SSH.

  3. In the Category pane, expand Connection, expand SSH, and then choose Auth. Complete the following:

    • Choose Browse.

    • Select the .ppk file that you generated for your key pair and choose Open.

  4. 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 to which you are connecting.

    • Choose Yes. A window opens and you are connected to your instance.
  5. In the command window, use root as the username and when prompted for a password, just press enter.