Skip to content

Instantly share code, notes, and snippets.

@lucwj
Created December 2, 2016 03:06
Show Gist options
  • Save lucwj/07470d2caaa73ce4b40d81a1e606d1c6 to your computer and use it in GitHub Desktop.
Save lucwj/07470d2caaa73ce4b40d81a1e606d1c6 to your computer and use it in GitHub Desktop.
A guide for Amazon Linux

Connecting to Your Linux Instance Using SSH

NYKFuel Stagin

Instance ID

i-985b1aa0

Locate the private key

/Users/luc/.ssh/nykfuel-luc.pem

To install the AWS CLI using the bundled installer

  1. Download the AWS CLI Bundled Installer using wget or curl.
  2. Unzip the package.
  3. Run the install executable.

On Linux and OS X, here are the three commands that correspond to each step:

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

If you don't have sudo permissions or want to install the AWS CLI only for the current user, you can use a modified version of the above commands:

$ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
$ unzip awscli-bundle.zip
$ ./awscli-bundle/install -b ~/bin/aws

Check AWS Version:

$ aws --version

It should look like this:

aws-cli/1.9.18 Python/2.7.10 Darwin/15.2.0 botocore/1.3.18

Config AWS first

aws configure

AWS Access Key ID [None]: [YOUR_ACCESS_KEY]
AWS Secret Access Key [None]: [YOUR_SCRET_KEY]
Default region name [None]: [YOUR_REGION_NAME]
Default output format [None]: [DEFAULT_IS_JSON]

Verify Fingerprint

aws ec2 get-console-output --instance-id i-985b1aa0

Connect to Amazon Linux Instance by SSH

ssh -i "nykfuel-luc.pem" [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment