Install and Use AWS CLI on Linux: A Step-by-Step Guide
AWS CLI on Linux allows you to interact with AWS services directly from the command line, enabling quick automation and management of cloud resources. This guide will walk you through the installation process, configuration, and essential tasks, such as creating IAM groups, users, and attaching policies.

Step 1: Install AWS CLI on Linux
Before you can start using AWS CLI, you’ll need to install it on your Linux machine. To do so, follow these simple steps:
- Download the AWS CLI installer for Linux from the official AWS website. You can use the following command to download it via
curl:curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" - Unzip the installer:
unzip awscliv2.zip - Run the installation:
sudo ./aws/install - Verify the installation by checking the AWS CLI version:
aws --version
Once installed, you can start configuring AWS CLI by setting up your credentials and default region.
Step 2: Configure AWS CLI on Linux
After installation, you need to configure AWS CLI to interact with your AWS account. Run the following command:
aws configure
You will be prompted to enter your AWS Access Key ID, Secret Access Key, Default Region Name, and Default Output Format. These credentials allow AWS CLI to authenticate and perform actions within your AWS environment.
Step 3: Create an AWS IAM Group
An IAM group is a collection of IAM users that allows you to assign permissions to multiple users at once. To create a group, you can use the following command:
aws iam create-group --group-name DB-Admins
You should receive a confirmation message, showing the group’s ARN and other details. You can confirm the creation by listing all IAM groups:
aws iam list-groups
Step 4: Attach a Policy to the IAM Group
Next, you can attach a policy to your IAM group. AWS offers both predefined and custom policies. If you want to attach an existing policy, use the ARN (Amazon Resource Name) to do so. Here’s how:
aws iam attach-group-policy --group-name DB-Admins --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
This command attaches the AdministratorAccess policy to the group. You can verify this by listing the policies attached to the group:
aws iam list-attached-group-policies --group-name DB-Admins
Step 5: Create an AWS IAM User
Now that your IAM group is ready with the appropriate policies, it’s time to create a user. This user will inherit the permissions from the group. Run the following command to create the user:
aws iam create-user --user-name Alice
Step 6: Add the User to the IAM Group
To grant the user the same permissions as the IAM group, you’ll need to add the user to the group. Use this command:
aws iam add-user-to-group --user-name Alice --group-name DB-Admins
Step 7: Attach Additional Policies to the User
If you want to grant the user specific permissions beyond the group’s scope, you can attach additional IAM policies directly to the user. Here’s an example of how to do it:
aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess --user-name Alice
This gives the user full access to Amazon S3 services.
Conclusion: Efficiently Manage AWS Resources with AWS CLI
By installing and configuring AWS CLI on Linux, you’ve taken the first step toward more efficient cloud resource management. Creating IAM groups, users, and attaching policies enables better control over permissions and access. If you’re looking for more ways to streamline your cloud infrastructure, consider leveraging ZippyOPS for consulting, implementation, and managed services.
ZippyOPS specializes in DevOps, DevSecOps, DataOps, AIOps, and MLOps to optimize cloud environments and automate operations. Whether you’re working with microservices, enhancing security, or modernizing your infrastructure, ZippyOPS provides tailored solutions to meet your needs.
For more information about cloud solutions, check out ZippyOPS Services or explore our solutions. You can also discover our products here, or watch tutorials on our YouTube channel.
For inquiries, reach out to us at sales@zippyops.com.



