Access EC2 using SSH Command

How To Access EC2 Linux via SSH

  1. Navigate to the EC2 Dashboard. Find your instance's Public/Private IP address.

  2. Ensure Security Group allows SSH port 22 from your source network.

  3. From your terminal or command prompt. Run below command

    1. ssh -i /path/key-pair-name.pem instance-user-name@instance-ip-address

  4. The following is an example response.

    1. The authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (198-51-100-1)' can't be established.

      ECDSA key fingerprint is l4UB/neBad9tvkgJf1QZWxheQmR59WgrgzEimCG6kZY.

      Are you sure you want to continue connecting (yes/no)?

  5. (Optional) Verify that the fingerprint in the security alert matches the fingerprint. If these fingerprints don't match, someone might be attempting a man-in-the-middle attack. If they match, continue to the next step.

  6. Enter Yes. You see a response like the following:

    1. Warning: Permanently added 'ec2-198-51-100-1.compute-1.amazonaws.com' (ECDSA) to the list of known hosts.


    • Related Articles

    • How To Enable Bock Public Access For Account

      Log in to the AWS Management Console and open the S3 service. Click on Account settings in the left sidebar. Locate the Block Public Access settings for this account section. Click Edit. Enable the desired Block Public Access options by checking the ...
    • How To Update S3 Policy

      Log in to the AWS Management Console and navigate to the S3 service. Select the bucket you want to modify. Open the bucket's Permissions settings. Find the Bucket Policy area and click to edit or add a policy. Enter or modify the JSON policy, ...