mfa

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2023 License: MIT Imports: 1 Imported by: 1

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL