Created
March 30, 2024 15:34
-
-
Save elliotwutingfeng/a3ed47816a149fc1b9e345a4706e349d to your computer and use it in GitHub Desktop.
One-liner Linux terminal command to generate TOTP code using oathtool (https://www.nongnu.org/oath-toolkit/oathtool.1.html)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# SHA1, 30 seconds, 6 digits; the most common configuration. | |
# Adjust accordingly if your OTP credential uses different parameter values. | |
# Upon entering this command, type in your TOTP secret (it will not be echoed back to the screen), then press 'Enter' | |
stty -echo;oathtool --totp=SHA1 --time-step-size=30s --digits=6 --base32 -;stty echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment