👾
ctrl-z
  • 👋Welcome to ctrl-z
  • Cheat Sheets
    • Helpful Command QR
    • Footprinting
    • Information Gathering
    • File Transfers
    • LFI
    • MetaSploit
      • Using msfconsole
      • Creating Metasploit Payloads
    • Shells
      • Shells and Payloads
      • Shell Cheatsheet
    • Password Attacks
    • Attacking Common Services
    • Pivoting & Port Forwarding
    • Web Attacks
      • SQL
        • MySQL & SQLi
        • SQLmap
      • Fuzzing w FFUF
      • Bruteforce w Hydra
      • XSS
    • Active Directory
      • Intro to AD
      • AD Enum&Attack
      • RPC-Client
      • 🥝mimikatz
      • NTLM Relay Attacks
    • 💢Buffer Overflow
    • Priv Esc
      • Linux Priv Esc
      • Windows Priv Esc
        • mimikatz
  • Tools
    • Containers
      • Kubernetes
      • Container Testing Methodology
      • Dropping Kali in your test space
    • Cloud
      • aws cli
    • Command Line
      • Linux Basic CML
      • Windows CML
      • Mac CML
    • Redteam & C2
      • Covenant C2
    • JS Deobuscation
    • Crackmapexec
  • Scripts
    • Priv Esc
  • Loot
  • Write Ups
    • Inject (active at the time)
Powered by GitBook
On this page
  • aws-cli
  • How to Use the AWS CLI
  • Step 1: Install the AWS CLI
  • Step 2: Configure the AWS CLI
  • Step 3: Use the AWS CLI
  • Conclusion
  1. Tools
  2. Cloud

aws cli

aws-cli

How to Use the AWS CLI

The AWS Command Line Interface (CLI) is a tool that allows you to interact with various AWS services via the command line. Here's a step-by-step guide to get you started:

Step 1: Install the AWS CLI

To start using the AWS CLI, you will first need to download and install it on your computer. You can do this by following the instructions provided in the AWS official documentation.

Step 2: Configure the AWS CLI

Once you have installed the AWS CLI, you will need to configure it with your AWS account credentials. To do this, open your terminal and run the following command:

aws configure

This will prompt you to enter your AWS access key ID, secret access key, default region, and output format. Follow the instructions on the screen to complete the configuration process.

Step 3: Use the AWS CLI

Once you have configured the AWS CLI, you can start using it to interact with various AWS services. Here are a few examples of how you can use the CLI:

List all Amazon S3 buckets

To list all the buckets in your Amazon S3 account, run the following command:

aws s3 ls

Upload a file to Amazon S3

To upload a file to a specific bucket in Amazon S3, run the following command:

aws s3 cp file.txt s3://my-bucket/

This command will copy the file named "file.txt" to the Amazon S3 bucket "my-bucket".

Download a file from Amazon S3

To download a file from Amazon S3, run the following command:

aws s3 cp s3://my-bucket/file.txt file.txt

This command will download the file named "file.txt" from the Amazon S3 bucket "my-bucket" to your local machine.

Create an Amazon S3 bucket

To create an Amazon S3 bucket, run the following command:

aws s3 mb s3://my-new-bucket

This command will create a new Amazon S3 bucket named "my-new-bucket".

Create an Amazon EC2 instance

To create an Amazon EC2 instance, run the following command:

aws ec2 run-instances --image-id ami-0c94855ba95c71c99 --count 1 --instance-type t2.micro --key-name my-key-pair --security-group-ids sg-xxxxxx --subnet-id subnet-xxxxxx

This command will launch a new Amazon EC2 instance with the specified parameters, such as the Amazon Machine Image (AMI) ID, instance type, key pair, security group, and subnet.

Create a new Amazon RDS instance

To create a new Amazon RDS instance, run the following command:

aws rds create-db-instance --db-instance-identifier mydbinstance --db-instance-class db.t2.micro --engine MySQL --master-username myuser --master-user-password mypassword

This command will create a new Amazon RDS instance with the specified parameters, such as the identifier, instance class, database engine, and master credentials.

These are just a few examples of what you can do with the AWS CLI. Refer to the AWS documentation for more information on how to use the CLI with different AWS services.

Conclusion

The AWS CLI is a powerful tool that allows you to interact with various AWS services via the command line. By following the steps outlined in this guide, you should now be able to get started with the AWS CLI and start using it to manage your AWS resources.

PreviousCloudNextCommand Line

Last updated 2 years ago