Skip to content

Instantly share code, notes, and snippets.

@FOLLGAD
Last active April 1, 2023 13:13
Show Gist options
  • Select an option

  • Save FOLLGAD/7cba4caa4539db173c4684ca95542778 to your computer and use it in GitHub Desktop.

Select an option

Save FOLLGAD/7cba4caa4539db173c4684ca95542778 to your computer and use it in GitHub Desktop.
Simple commandline 2FA tool. Alternative to Google Authenticator and Authy apps.
DB_FILE=example-2fa-db.txt
# use fuzzyfinder to search for which service to use
LINE="$(cut -d: -f1 $DB_FILE | fzf)"
# get the private key of line
AUTH_CODE="$(grep "^$LINE:" $DB_FILE | cut -d: -f2-)"
# print the temporary 2fa code
echo "$(oathtool -b --totp "$AUTH_CODE")"
discord: fadh 2cas 8fda 83fs
stripe: 8dsa 9fad d89a 8fad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment