How To Install And Configure The AWS CLI On Linux OS

The Amazon Web Service Command Line Interface(CLI) is the fastest and easiest way to connect to AWS services and products.

Some instances have the CLI pre-installed such as the Amazon Linux instances while instances like the Red Hat Linux don’t. In th…


This content originally appeared on DEV Community and was authored by Shola Umakhihe

The Amazon Web Service Command Line Interface(CLI) is the fastest and easiest way to connect to AWS services and products.

Some instances have the CLI pre-installed such as the Amazon Linux instances while instances like the Red Hat Linux don’t. In this article, I will show you how to install and configure the CLI in an instance.

You’ll need a secure shell connection (SSH), to your AWS instance account and then configure and install.

Pre-requisite: AWS account, SSH Access key, Linux OS installed computer, internet access and a stable mind.

STEP 1: Create an instance in your EC2

- Login to your AWS management console and navigate to EC2
- Create an EC2 with the Red Hat Linux AMI
- Select Network and security in the navigation pane, and enter key pairs
- Select Create Key Pair.
- Then, select the format of the file (. pem)
- Then, download

STEP 2: Connect to your instance using SSH

- Open your terminal with Shift + Ctrl + T
- Navigate to your downloads or anywhere you must have downloaded the .PEM file with “cd downloads”
- Change the permission on it with chmod 400 <filename.pem>
- Go to your AWS management console, go instance.
- Select the the instance type
- By the description tab copy the IPv4 Public IP value.
- Go back to your terminal and run this command ssh -i labsuser.pem ec2-user@<public-ip> (replace <public-ip> with your IPv4 Public IP)
- Type “yes” at the prompt.
- Voila, connected sucessfully

STEP 3: Install the AWS CLI on Red Hat Linux

Now that you have an active SSH connection to the Red Hat Linux instance running on Amazon EC2, next is to install AWS CLI.

- Run sudo yum install -y unzip
- Then, run curl “https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o “awscliv2.zip”
- Then, unzip awscliv2.zip
- Then, sudo ./aws/install
- Verify that AWS CLI is now working by running the following command: aws help
- At the : prompt, type q to exit.
- You are set.

STEP 4: Configure the AWS CLI to connect to your AWS Account

Time to connect your AWS account to your AWS CLI. Go to the active SSH session terminal window and run aws configure. At the prompt enter your AWS Access Key ID and AWS Secret Access Key

We are all set, now you can work on your EC2 instance and every other AWS service from your personal machine using your local terminal.


This content originally appeared on DEV Community and was authored by Shola Umakhihe


Print Share Comment Cite Upload Translate Updates
APA

Shola Umakhihe | Sciencx (2022-06-13T00:40:24+00:00) How To Install And Configure The AWS CLI On Linux OS. Retrieved from https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/

MLA
" » How To Install And Configure The AWS CLI On Linux OS." Shola Umakhihe | Sciencx - Monday June 13, 2022, https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/
HARVARD
Shola Umakhihe | Sciencx Monday June 13, 2022 » How To Install And Configure The AWS CLI On Linux OS., viewed ,<https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/>
VANCOUVER
Shola Umakhihe | Sciencx - » How To Install And Configure The AWS CLI On Linux OS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/
CHICAGO
" » How To Install And Configure The AWS CLI On Linux OS." Shola Umakhihe | Sciencx - Accessed . https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/
IEEE
" » How To Install And Configure The AWS CLI On Linux OS." Shola Umakhihe | Sciencx [Online]. Available: https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/. [Accessed: ]
rf:citation
» How To Install And Configure The AWS CLI On Linux OS | Shola Umakhihe | Sciencx | https://www.scien.cx/2022/06/13/how-to-install-and-configure-the-aws-cli-on-linux-os/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.