oathtool


For 2FA, Two-Factor Authentication, we install Google Authenticator on phone.
I tried oathtool, which gives the same code as Google Authenticator, as expected.
Here are the steps:
Installation:
To get oathtool, OATH one-time password tool, to my Ubuntu:
$ sudo apt install oathtool gpgv2
To get the secret key from Google:
go to myaccount.google.com, in 2-Step Verification section.
It looks like this: 5j6bpmmhulttoktetk6yidf3xwua0000
Verification, in a 30 seconds time window:
Go to Google Authenticator and record the code, 460273 in my case.
Quickly on Ubuntu, run this command:
$ oathtool –verbose –totp –base32 “5j6bpmmhulttoktetk6yidf3xwua0000”
output:
Hex secret: ea7c17b187a2e7372a649abd840cbbbd00000000
Base32 secret: 5J6BPMMHULTTOKTETK6YIDF3XWUA0000
Digits: 6
Window size: 0
Step size (seconds): 30
Start time: 1970-01-01 00:00:00 UTC (0)
Current time: 2019-05-20 00:45:15 UTC (1558313115)
Counter: 0x318995A (51943770)
460273
As seen here, 460273 matches the code from Google Authenticator.

oathtool

Advertisements