Skip to content

TimeleapLabs/aws-cli-mfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS CLI MFA Helper

This tool makes doing MFA on the terminal a bit easier when working with AWS CLI tools.

Installation

$ npm i -g @kenshi.io/aws-cli-mfa

Usage

Run the following command to do an MFA auth:

$ aws-mfa <user> [profile]

Replace <user> with the name of the user, and [profile] with your profile. Passing profile is not required.

This command then queries AWS for added MFA devices and asks you choose one if there are more than one devices attached to your account. Once done, the tool asks for your MFA code, if valid the tool writes your aws MFA credentials to a new profile which can be used with AWS CLI tools.

The name of the newly created profile will be ${profile}-mfa if a profile is passed, otherwise it will be just named mfa.

Example

$ aws-mfa john-doe acme
$ aws ecr get-login-password --profile acme-mfa | docker login ...