2019-03-12 12:37:06 +08:00
|
|
|
# oathtool
|
|
|
|
|
2021-08-02 04:41:09 -04:00
|
|
|
> OATH 一次性密码工具。
|
2023-11-06 23:14:12 +05:30
|
|
|
> 更多信息:<https://www.nongnu.org/oath-toolkit/oathtool.1.html>.
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2021-08-02 04:41:09 -04:00
|
|
|
- 生成 TOTP 令牌(行为类似于 Google Authenticator):
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2024-01-01 10:38:53 +01:00
|
|
|
`oathtool --totp --base32 "{{密码}}"`
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2021-08-02 04:41:09 -04:00
|
|
|
- 根据给定时间产生特定的 TOTP 令牌:
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2024-01-01 10:38:53 +01:00
|
|
|
`oathtool --totp --now "{{2004-02-29 16:21:42}}" --base32 "{{密码}}"`
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2021-08-02 04:41:09 -04:00
|
|
|
- 验证 TOTP 令牌:
|
2019-03-12 12:37:06 +08:00
|
|
|
|
2024-01-01 10:38:53 +01:00
|
|
|
`oathtool --totp --base32 "{{密码}}" "{{令牌}}"`
|