Skip to content

Instantly share code, notes, and snippets.

@thomsh
Last active January 30, 2020 04:39
Show Gist options
  • Save thomsh/dc9b3c70a3c02e035142d8d5ca415381 to your computer and use it in GitHub Desktop.
Save thomsh/dc9b3c70a3c02e035142d8d5ca415381 to your computer and use it in GitHub Desktop.
How to generate QR code for Google Authenticator
#!/usr/bin/env bash
NAME="$1"
SECRET="$2"
exec qrencode -d 300 -s 10 -t ansiutf8 "otpauth://totp/${NAME}?secret=${SECRET}"
#PNG #exec qrencode -o /dev/shm/ga.png -d 300 -s 10 "otpauth://totp/${NAME}?secret=${SECRET}"
@thomsh
Copy link
Author

thomsh commented Oct 21, 2019

To compute GA: oathtool --base32 --totp "$SECRET"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment