Generate TOTP(Time-based One-time Password) token with CLI.
- Download from Release.
- Unzip and move to the directory of PATH.
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
$ mfa gen amazon
999999
$ mfa list
amazon
google
github
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
- Add test