Skip to content

Instantly share code, notes, and snippets.

@martint17r
Created January 5, 2015 11:40
Show Gist options
  • Save martint17r/b44e8db9aae0a931a99a to your computer and use it in GitHub Desktop.
Save martint17r/b44e8db9aae0a931a99a to your computer and use it in GitHub Desktop.
Generate TOTP QRcode for Google Authenticator for 2FA on linux debian wheezy
#!/bin/bash
USERNAME=$1
HOSTNAME=$(hostname --fqdn)
qrencode -t ANSI256 -o - $(echo otpauth://totp/$USERNAME@$HOSTNAME?secret=$(oathtool --totp -v $(grep $USERNAME /etc/users.oath | cut -f 4) | grep Base32 | cut -d " " -f 3))
@ekkis
Copy link

ekkis commented Aug 17, 2022

where do I get /etc/users.oath?

@bonen02
Copy link

bonen02 commented Jan 24, 2024

@martint17r: thanks for this

@ekkis

where do I get /etc/users.oath?

It's the pam_oath file, where token seeds are stored

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