-
-
Save ccampo133/8fba87470c9dda22159fe57644c5a9c4 to your computer and use it in GitHub Desktop.
Generate an MFA TOTP token. Secret keys are stored in your ~/.mfa directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Generate an MFA TOTP token. Secret keys are stored in your ~/.mfa directory | |
# | |
# Requires oathtool: http://www.nongnu.org/oath-toolkit/man-oathtool.html | |
# | |
# Example: I might have the following... | |
# $ cat ~/.mfa/aws.mfa | |
# ASDLJGJ893AS7JJF83NLSD9RTSMF81NSLA85SNSA81MASNFHG75KAKSKJV0192F7 | |
# | |
# ...and then running like so would produce something like: | |
# $ mfa aws | |
# 789102 | |
# | |
oathtool --base32 --totp "$(cat ~/.mfa/"$1".mfa) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment