Last active
October 5, 2022 08:22
-
-
Save meznak/e57b0f57f85e32088e686145d38b3fc7 to your computer and use it in GitHub Desktop.
Quickly generate QR codes for Google Authenticator
This file contains hidden or 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
#!/bin/env bash | |
### | |
# Quickly generate QR codes to easily repopulate Google Authenticator. | |
# To use this, you'll have to have recorded your auth secret when you activated | |
# multi-factor authentication. When run, this script will draw QR codes into | |
# your terminal, which you can then scan with Google Authenticator. | |
# | |
# NB: These secrets should be treated with the same care as your password. I recommend | |
# you keep this file encrypted when not in use. | |
# | |
# REQUIRES: python module 'qrcode' -- https://pypi.python.org/pypi/qrcode | |
### | |
HISTCONTROL=ignoreboth | |
# IMPORTANT: Prefix each line with a space so it isn't logged in your bash history. | |
# | |
# Use the format below, replacing USERNAME, SECRET, and SITE with appropriate values. | |
# Repeat the command for each site you want to add to Authenticator. | |
qrcode "otpauth://totp/USERNAME?secret=SECRET&issuer=SITE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment