Connecting to Instances in Windows

This section describes how to connect to instances running Windows.

How to Get the Instance Password

To access an instance, you must get its administrator password.

[Note]Note

The Windows password is only generated the first time an AMI is launched. It is not generated for rebundled AMIs or after the password is changed on an instance.

The password is encrypted using the key pair that you provided and stored within the <password> tags of the console output.

To get the administrator password

  1. Enter the following command:

    PROMPT>  ec2-get-password -k gsg-keypair

    Amazon EC2 returns the Windows password.

    [Note]Note

    Unless the key pair is in the current directory, you must specify the full key pair path.

  2. Write down or save the password.

    After logging in, you can change it.

How to Get the RDP Certificate

To verify you are connecting to the correct server, you must get the RDP certificate.

To get the RDP certificate

  1. Enter the following command:

    PROMPT>  ec2-get-console-output instance_id
    
    date_time <RDPCERTIFICATE><DN>CN=instance_id, OU=EC2, O=Amazon.com</DN><THUMBPRINT>rdp_certificate</THUMBPRINT></RDPCERTIFICATE>
    

    Amazon EC2 returns the RDP certificate information.

  2. Write down or save the information.

How to Connect to the Instance

This section describes how to connect to your instance.

To connect to your instance

  1. Get the public IP address of your local machine by going to a search engine, entering "what is my IP address," and using one of the provided services.

  2. Authorize the security group to allow Remote Desktop access:

    PROMPT>  ec2-authorize default -p 3389 -s your_ip_address/32
    PERMISSION     default  ALLOWS  tcp     3389      3389      FROM    CIDR   your_ip_address/32
  3. Retrieve the FQDN of your instance.

    This example retrieves the FQDN of the i-ae0bf0c7 instance.

    PROMPT>  ec2-describe-instances i-ae0bf0c7 
    				RESERVATION  r-7430c31d  924417782495  default
    				INSTANCE  i-ae0bf0c7  ami-2bb65342  ec2-67-202-7-236.compute-1.amazonaws.com  ip-10-251-31-162.ec2.internal  running  gsg-keypair  0               m1.small        2008-03-21T16:19:25+0000	us-east-1a 

    In this example, the FQDN is ec2-67-202-7-236.compute-1.amazonaws.com

  4. On the taskbar, click Start, point to Programs, point to Accessories, point to Communications, and click Remote Desktop Connection.

    The Remote Desktop Connection dialog box appears.

    1. Enter the FQDN in the Computer field.

    2. Click the Advanced or Security tab.

    3. Select Warn me or Attempt authentication from the list box.

    4. Click Connect.

      The Amazon EC2 instance returns a security alert.

  5. To verify the instance, click View Certificate.

    The Certificate page appears.

  6. Click the Details tab.

    The Details page appears.

  7. Select the Thumbprint and verify it against the value you wrote down in previous procedure.

  8. If it matches, click OK and then Yes.

    The Remote Desktop Connection client connects to the instance.

  9. Enter "administrator" as the user name and the instance password. .

    You can now use the Amazon EC2 instance as you would any Windows-based system.

[Note]Note

If you plan to allow other users to remotely access the instance, you must add them to the Remote Desktop Users group.