Skip to content
/ mfa-aws Public

This script automates the process of authenticating with a Multi Factor Authentication (MFA) token when using the AWS Command Line Interface (CLI)

Notifications You must be signed in to change notification settings

t14/mfa-aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Based on https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/ This script automates the process of authenticating with a Multi Factor Authentication (MFA) token when using the AWS Command Line Interface (CLI)

Getting started

brew install python3
sudo python3 setup.py install

You should now be able to run this script from anywhere in the terminal

# Now try
mfa-aws -h

Available scripts

Multi factor auth for cli - automates MFA on the CLI When using it for the first time run the setup command

mfa-aws setup

Anytime you need mfa auth on the cli you can run the command like below

mfa-aws mfa <aws-profile> <mfa-token-code>

Once you have successfully authenticated with the above command run your aws commands with the --profile flag prefixing your aws profile name with -mfa for example

aws s3 ls --profile <aws-profile>-mfa

Prerequisite

Make sure you have installed AWS CLI

About

This script automates the process of authenticating with a Multi Factor Authentication (MFA) token when using the AWS Command Line Interface (CLI)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages