Connect to Your Instance
After you launch your instance, you can connect to it and use it the way that you'd use a computer sitting in front of you.
After you launch an instance, it can take a few minutes for the instance to be ready so that you can connect to it. Check that your instance has passed its status checks - you can view this information in the Status Checks column on the Instances page.
Before you try to connect to your instance, be sure that you've completed the following tasks:
Get the public DNS name of the instance
You can get the public DNS for your instance using the Amazon EC2 console (check the Public DNS column; if this column is hidden, click the Show/Hide icon and select Public DNS). If you prefer, you can use the describe-instances (AWS CLI) or ec2-describe-instances (Amazon EC2 CLI) command.
Locate the private key
You'll need the fully-qualified path of the
.pemfile for the key pair that you specified when you launched the instance.
Enable inbound SSH traffic from your IP address to your instance
Ensure that the security group associated with your instance allows incoming SSH traffic from your IP address. For more information, see Authorizing Network Access to Your Instances.
Your default security group does not allow incoming SSH traffic by default.
There are several ways to connect to a Linux instance. Choose the method that meets your needs:
After you've successfully launched and connected to your instance, you can do any of the following:
Continue to the next step in this tutorial, Add a Volume to Your Instance.
Skip to the last step in this tutorial, Clean Up Your Instance and Volume, to terminate the instance so that you don't continue to incur charges.
Option 1: Connect Using Your Browser
You must have Java installed and enabled in the browser. If you don't have Java already, you can contact your system administrator to get it installed, or follow the steps outlined in the following pages: Install Java and Enable Java in your web browser.
To connect to your Linux instance using a web browser
From the Amazon EC2 console, click Instances in the navigation pane.
Select the instance, and then click Connect.
Click A Java SSH client directly from my browser (Java required).
Amazon EC2 automatically detects the public DNS name of your instance and populates Public DNS for you. It also detects the key pair that you specified when you launched the instance. Complete the following, and then click Launch SSH Client.
In User name, enter
For Amazon Linux, the user name is
ec2-user. For RHEL5, the user name is either
ec2-user. For Ubuntu, the user name is
ubuntu. For Fedora, the user name is either
ec2-user. For SUSE Linux, the user name is either
ec2-user. Otherwise, if
rootdon't work, check with your AMI provider.
In Private key path, enter the fully qualified path to your private key (
.pem) file, including the key pair name; for example:
(Optional) Click Store in browser cache to store the location of the private key in your browser cache. This enables Amazon EC2 to detect the location of the private key in subsequent browser sessions, until you clear your browser's cache.
If necessary, click Yes to trust the certificate, and click Run to run the MindTerm client.
If this is your first time running MindTerm, a series of dialog boxes asks you to accept the license agreement, to confirm setup for your home directory, and to confirm setup of the known hosts directory. Confirm these settings.
A dialog prompts you to add the host to your set of known hosts. If you do not want to store the host key information on your local computer, click No.
A window opens and you are connected to your instance.
If you clicked No in the previous step, you'll see the following message, which is expected:
Verification of server key disabled in this session.
Option 2: Connect from Windows Using PuTTY
PuTTY doesn't use
.pem files, it uses
If you haven't already generated a
.ppk file, do so now. For more information,
see To prepare to connect to a Linux instance from Windows using PuTTY.
To connect to your Linux instance using PuTTY
Start PuTTY (from the Start menu, click All Programs > PuTTY > PuTTY).
In the Category pane, select Session and complete the following fields:
In the Host Name box, enter ec2-user@public_dns_name.
Under Connection type, select SSH.
Ensure that Port is 22.
In the Category pane, expand Connection, expand SSH, and then select Auth. Complete the following:
.ppkfile that you generated for your key pair, and then click Open.
Click 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. Click Yes. A window opens and you are connected to your instance.
Option 3: Connect from Mac or Linux Using an SSH Client
Your Mac or Linux computer most likely includes an SSH client by default. You can check for an SSH client by typing ssh at the command line. If your computer doesn't recognize the command, the OpenSSH project provides a free implementation of the full suite of SSH tools. For more information, see http://www.openssh.org.
Open your command shell and run the following command:
Next, run the following command:
ssh -i /
For more information, see Connecting to your Linux Instance.
For RHEL5, the user name is either
For Ubuntu, the user name is
For Fedora, the user name is either
For SUSE Linux, the user name is either
root don't work, check with your AMI provider.