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