In this tutorial, I will show you how to set up and configure the AWS CLI on a AWS Linux AMI.
- You have created your AWS EC2 instance using the standard Linux AMI and can get access to it using SSH
- You have set up security credentials in IAM and have downloaded your access keys
Configuring the AWS CLI
Step 1 – SSH into the instance and login as ec2-user
Step 2 – Type the following at the prompt
$ aws configure
Step 3 – Enter your Access Key ID
Step 4 – Enter your Secret Access Key
Step 5 – Enter the Default region name
Step 6 – Enter the Default output format
$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json
This tutorial shows you how to connect to your AWS EC2 instance from a Windows 10 computer using SSH.
- Download PuTTY a SSH and Telnet client for Windows
- Ensure you have your .pem file which you will have downloaded when you set up your key pair when creating your EC2 instance
- Create a .ppk file from a .pem file – see How to Create a PPK file from a PEM file – Windows 10
- Make a note of your instance’s public IP address
Connecting to the Instance
Step 1 – Open PuTTY, you will see a PuTTY Configuration window.
Step 2 – In the Host Name (or IP address) field enter the public IP address of your EC2 instance. Leave the port number at 22.
You can also enter the username to save time using ec2-user@ and then the IP address to save entering the username when logging in.
Step 3 – Click on the ‘+’ sign next to SSH to open the list of options.
Step 4 – Click on ‘Auth’.
Step 5 – Click on ‘Browse’ and select the .ppk private key file you created from the .pem file using PuTTYgen.
Step 6 – Enter a name for the session in the ‘Saved Sessions’ field to save the settings entered above for quicker access next time you want to SSH into the same instance.
Step 7 – Click ‘Open’ and the terminal window should open