Skip to content

Simple terminal command to login to AWS on the CLI using an MFA token

License

Notifications You must be signed in to change notification settings

Semmu/aws-mfa-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

aws-mfa-login

Simple shell script to login to AWS on the CLI with an MFA token.

Installation

  • git clone this repository where you'd like.

  • Add aws-mfa-login to your $PATH, e.g

    sudo mv aws-mfa-login /usr/local/bin

"Configuration"

The first time you run aws-mfa-login it is going to ask for your MFA device's ARN identifier, which will be stored in ~/.aws/mfa-arn and used afterwards.

Also, if you haven't configured aws yet, it will force you to do it as well by running aws configure.

Usage

Run the script and pass your current MFA token as a parameter, e.g.

aws-mfa-login 123456

It will start a subshell for you where the temporary access credentials are set as environment variables. From that point on aws commands should work as expected.

You can validate that it set the environment variables by running env | grep AWS.

License

MIT

About

Simple terminal command to login to AWS on the CLI using an MFA token

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages