Re: two-factor auth enabling problem
| Newsgroups | gmane.os.freebsd.questions |
|---|---|
| Message-ID | <[email protected]> |
On Friday, February 6th, 2026 at 23:23, Gary Aitken <[email protected]> wrote: > "Scan this QR code or enter the plain text key into a TOTP app > (e.g. Google Authenticator, Authy, Duo Mobile) and > enter the code in the field below to activate two-factor authentication." [...] > Somewhat lost here... any help much appreciated > > Gary I've used Python's "pyotp" to generate TOTP codes Just copy the secret into a file (say 'redmine.secret') and then simply do $ ./totp redmine.secret 506771 $ -- code (file totp, chmod u+x) ----------------------------------- #!/usr/bin/python3 import base64 import pyotp import sys with open(sys.argv[1]) as f: base32encodedsecret = f.readline().strip() print(pyotp.TOTP(base32encodedsecret).now()) -- end code -------------------------------