Google Authenticator QR Code

By steve, 30 July, 2018

In order to re-generate the QR code for an existing google authenticator, the following command can be used once the qrencode package has been installed:

echo "otpauth://totp/label?secret=`head -1 ~username/.google_authenticator `" | qrencode -t ANSI -o -

For example, the following would create a QR code with the label fred@www.mydomain.com for the QR code associated with the username fred
echo "otpauth://totp/fred@www.mydomain.com?secret=`head -1 ~fred/.google_authenticator `" | qrencode -t ANSI -o -

Comments