Hitesh Sahu
Hitesh SahuHitesh Sahu
  1. Home
  2. ›
  3. posts
  4. ›
  5. …

  6. ›
  7. CLI

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🐙 Octopuses have three hearts and blue blood.

🍪 This website uses cookies

No personal data is stored on our servers however third party tools Google Analytics cookies to measure traffic and improve your website experience. Learn more

Loading ⏳
Fetching content, this won’t take long…


💡 Did you know?

🐙 Octopuses have three hearts and blue blood.
AWS

    AI-AgenticAI

    AI-DeepLearning

    AI-GenAI

    AI-Infrastructure

    AI-Machine-Learning

    AI-Math

    AWS
    • Introduction to AWS


    • AWS Global Infrastructure And Management


    • AWS Provisonsing Resources


    • AWS Compute Services


    • AWS Serverless & Other Services


    • AWS Streaming Resources (SQS, SNS, Kinesis, MQ)


    • AWS Storage Services


    • AWS Database Services


    • AWS Networking & Content Delivery


    • Securing AWS Resources and User Access


    • Architecting AWS Solutions effectively


    • AWS Monitoring and Observability


    • AWS Code Management & CI/CD


    • Budgeting & Cost Management on AWS


    • AWS Cheat Sheet


    • AWS CLI Tips & Tricks


    • AWS Services by Category


    • AWS Index


    Azure

    kubernetes

    Management

    Programming

    Terraform

    Z_Appendix

Cover Image for AWS CLI Tips & Tricks
AWS

AWS CLI Tips & Tricks

Connect with EC2 Instance, Configure AWS CLI, Dry Run, Decode Error Message, MFA with CLI

AWS
Cloud
CLI
Command Line
DevOps
← Previous

Azure Budgeting & Cost Management

Next →

AWS Cheat Sheet

Connect with EC2 Instance

Ip address is public IP of EC2 Instance

  • chmod 0400 Hassium.pem

  • ssh -i Hassium.pem ec2-user@52.59.11.125

ssh -i Hassium.pem ec2-user@3.120.129.217

Configure AWS

 aws configure --profile <profile -name>
  • Access key ID : AKIAIOSFODNN7EXAMPLE
  • Secret access key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
  • Region: eu-central-1
  • out format: text

Dry Run( --dry-run)

run command without changing any AWS resource to check permission to access resource

  • supported by set of CLI commands

     aws ec2 run-instances help
    
     aws ec2 run-instances --dry-run
    

STS Decode Error Messages

decode error messages from AWS on CLI

  • STS DecodeMessage permission must be given to EC2 IAM Policy before requesting decode

     aws sts decode-authorization-message   --encoded-message <message to decode>
    

MFA with CLI

Fetch & Store temporary credentials from STS into a config profile to access AWS resources

aws sts get-session-token -- serial-number <ARN of registered MFA Device> -- token-code <Code on the device> 

CLI Cheat Sheet

CMDUsage
aws configuresetup account with access key
aws configure --profile profile -namesetup account & store config as a profile
aws iam list-userslist users
aws sts decode-authorization-message --encoded-message message to decodeDecode error blob on CLI
aws command --dry-runto check permission to run a command
aws sts get-session-token -- serial-number ARN of registered MFA Device -- token-code Code on the deviceGet Temporary Access Token

Related Posts

  • TF CMD Cheatsheet — the IaC-side command reference to pair with these AWS CLI commands
Hitesh Sahu
Written by Hitesh Sahu, a passionate developer and blogger.

Wed Oct 08 2025

Share This on

← Previous

Azure Budgeting & Cost Management

Next →

AWS Cheat Sheet

AWS/CLI
Let's work together
hiteshkrsahu@gmail.com
Munich 🥨, Germany 🇩🇪, EU
Playstore
Hitesh Sahu's apps on Google Play Store
Need Help?
Let's Connect
Navigation
  Home/About
  Skills
  Work/Projects
  Lab/Experiments
  Contribution
  Awards
  Art/Sketches
  Thoughts
  Contact
Links
  Sitemap
  Legal Notice
  Privacy Policy

Made with

NextJS logo

NextJS by

hitesh Sahu

| © 2026 All rights reserved.