Skip to content
/ mfa Public

Generate TOTP(Time-based One-time Password) token with CLI.

License

Notifications You must be signed in to change notification settings

k-saiki/mfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mfa

Generate TOTP(Time-based One-time Password) token with CLI.

Installation

  • Download from Release.
  • Unzip and move to the directory of PATH.

Configuration

Default config file is $HOME/.mfa/secrets.yml or $HOME/.mfa/secrets.yaml .

service:
  - name: amazon
    secret: "your secret key"
  - name: google
    secret: "your secret key"
  - name: github
    secret: "your secret key"

You can change config file path to use environment variable.

$ export MFA_CONFIG=/path/to/file

Usage

Generate token

$ mfa gen amazon
999999

List services

$ mfa list
amazon
google
github

Use case

assume-role with direnv.

$ echo 'eval $(mfa gen aws | assume-role <profile name>)' > .envrc
$ direnv allow
direnv: loading .envrc
MFA code:
direnv: export +ASSUMED_ROLE +AWS_ACCESS_KEY_ID +AWS_SECRET_ACCESS_KEY +AWS_SECURITY_TOKEN +AWS_SESSION_TOKEN

TODO

  • Add test

About

Generate TOTP(Time-based One-time Password) token with CLI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages