oath-toolkit

Generate and verify one-time passwords (OTP) for two-factor authentication

brewmacoslinux
Try with needOr install directly
Source

About

Tools for one-time password authentication systems

Commands

oathtool

Examples

Generate a TOTP (time-based one-time password) from a base32 secret$ oathtool --totp -b JBSWY3DPEBLW64TMMQ======
Generate an HOTP (HMAC-based one-time password) with counter increment$ oathtool -b JBSWY3DPEBLW64TMMQ======
Verify a TOTP code against a secret with time window tolerance$ oathtool --totp -b -w 1 JBSWY3DPEBLW64TMMQ====== 123456