Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»AWS»How to Install AWS CLI on Linux

    How to Install AWS CLI on Linux

    By RahulOctober 7, 20223 Mins Read

    The AWS CLI is a command line interface built on top of the AWS APIs. It makes it easy to manage and automate the usage of Amazon Web Services directly from your terminal without having to use a browser or third-party applications. In this article, we will learn how to install AWS CLI on Linux operating system. The official documentation for AWS CLI is available at https://docs.aws.amazon.com/cli/. You can also read about its general usage at https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-help.html. Below are some common scenarios where you may need to install AWS CLI on Linux operating system and their solutions:

    Advertisement

    How to Install AWS CLI on Linux

    The AWS CLI version 2 packages are available under the default repositories. You can use the package manager for installing AWS CLI v2 on your Linux systems.

    Choose one of the below commands to install:

    • Ubuntu and Debian Systems
      sudo apt install awscli 
      
    • Fedora and CentOS 8
      sudo dnf install awscli 
      
    • CentOS 7 and Scientific Linux
      sudo yum install awscli 
      
    • Other than the package manager, you can directly install using source code. This will install the latest awscli version on any Linux platform.
      curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 
      unzip awscliv2.zip 
      sudo ./aws/install 
      

    Generate Access Credentials

    To use AWS CLI with your AWS credentials, you need to set the credentials of your AWS account in the environment variables of your system. The credentials are used to authenticate your request in order to access the AWS APIs using AWS CLI. If you are accessing an Amazon Web Services (AWS) resource from a computer that is not registered with AWS, you need to authenticate as an AWS user.

    To generate new credentials follow:

    • Head to AWS Security Credentials.
    • Expand option Access keys (access key ID and secret access key)
    • Click the button Create New Access Key
    • Copy the access key ID and secret access key and save to a safe place

    Configure AWS CLI

    You can authenticate with AWS and set your credentials for the number of AWS services from the command line. AWS credentials are managed using credentials profiles. Credentials profiles store your account name, access key ID, and secret access key. Credentials are selected when you issue the AWS CLI command. You can manage the credentials through the AWS console or from the command line.

    To set credentials in the AWS CLI, you can use the following command:

    aws configure 
    

    This will prompt for AWS Access Key ID and Secret Access Key created in the above step.

    AWS Access Key ID [None]: ABCDEFXXXXXXXXDKKDFJ
    AWS Secret Access Key [None]: 3SDFskjf8KDfjksdf9sdfjsdkfjkKSDKSJFKD
    Default region name [None]: us-east-1
    Default output format [None]:
    

    That’s it. Your system is configured with the AWS CLI tools.

    Working with AWS CLI Commands

    AWS CLI tools provide your option to manage multiple services via the command line. To get help about uses type:

    aws help 
    

    Here are a few example commands to work with aws cli:

    • List all the instances
      aws ec2 describe-instances
      
    • List instances from other zone
      aws ec2 describe-instances --region=us-west-1
      
    • List S3 buckets
      aws s3 list
      

    Conclusion

    The article discussed the installation of AWS CLI on Linux and the ways to install the AWS SDK using pip. AWS CLI is a command line interface built on top of the AWS APIs. It makes it easy to manage and automate the usage of Amazon Web Services directly from your terminal without having to use a browser or third-party applications.

    amazon aws awscli ec2
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Create AWS Cognito User with AWSCLI

    How to Create User Manually in AWS Cognito (CLI)

    How to Enable CORS in S3 Bucket

    How To Configure CORS in Amazon S3 Buckets

    Shell Script to Backup MySQL Databases to Amazon S3

    Backup MySQL Databases to Amazon S3 (Shell Script)

    View 2 Comments

    2 Comments

    1. Tanmoy on April 19, 2015 9:49 am

      I have multiple AWS account with me. Is there any way to use any of them from the same system. If yes then how do I configure all of them in a single system?

      Reply
    2. Yohanes Raymond on November 6, 2014 4:21 am

      Hi,

      Looks like amazon is depreciating SOAP Requests after December 2014.
      http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-soap-api.html

      You should use Query API for Amazon EC2, or the SDKs for AWS regarding their website.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.