Authenticate to AWS with MFA 🔐
shell
curl -OL https://github.com/jhandguy/aws-mfa/releases/download/v0.1.0/x86_64-apple-darwin.gz && tar xzvf x86_64-apple-darwin.gz
shell
curl -OL https://github.com/jhandguy/aws-mfa/releases/download/v0.1.0/aarch64-apple-darwin.gz && tar xzvf aarch64-apple-darwin.gz
shell
curl -OL https://github.com/jhandguy/aws-mfa/releases/download/v0.1.0/i686-unknown-linux-gnu.gz && tar xzvf i686-unknown-linux-gnu.gz
shell
curl -OL https://github.com/jhandguy/aws-mfa/releases/download/v0.1.0/x86_64-unknown-linux-gnu.gz && tar xzvf x86_64-unknown-linux-gnu.gz
shell
curl -OL https://github.com/jhandguy/aws-mfa/releases/download/v0.1.0/aarch64-unknown-linux-gnu.gz && tar xzvf aarch64-unknown-linux-gnu.gz
```shell ➜ aws-mfa -h
aws-mfa Authenticate to AWS with MFA 🔐
USAGE:
aws-mfa [OPTIONS] --code
ARGS:
OPTIONS:
-c, --code MFA code
-d, --duration
Add in ~/.aws/credentials
:
shell
[<profile_name>-noauth]
aws_access_key_id = <aws_access_key_id>
aws_secret_access_key = <aws_secret_access_key>
Run in terminal:
shell
aws-mfa -p <profile_name> -c <mfa_code>
Output in ~/.aws/credentials
:
shell
[<profile_name>]
aws_access_key_id = <aws_access_key_id>
aws_secret_access_key = <aws_secret_access_key>
aws_session_token = <aws_session_token>