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?

🦈 Sharks existed before trees 🌳.

πŸͺ 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?

🍌 Bananas are berries, but strawberries are not.
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

    Hobbies

    kubernetes

    Management

    Programming

    Terraform

    Z_Appendix

    0-root

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

CMD Usage
aws configure setup account with access key
aws configure --profile profile -name setup account & store config as a profile
aws iam list-users list users
aws sts decode-authorization-message --encoded-message message to decode Decode error blob on CLI
aws command --dry-run to check permission to run a command
aws sts get-session-token -- serial-number ARN of registered MFA Device -- token-code Code on the device Get Temporary Access Token
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
+49 176-2019-2523
hiteshkrsahu@gmail.com
WhatsApp
Skype
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.