是否有命令行两步验证验证码生成器?

dan*_*dan 26 ssh authentication pam

我使用双因素身份验证管理服务器。输入普通服务器密码后,我必须使用Google Authenticator iPhone应用程序获取6位验证码才能输入。此处描述了设置:http : //www.mnxsolutions.com/security/two-factor-ssh-with-google-authenticator.html

我想要一种仅使用我的笔记本电脑而不是我的 iphone 来获取验证码的方法。必须有一种方法可以为命令行应用程序生成这些验证码,并为您提供当前 30 秒窗口的代码。

有没有程序可以做到这一点?

EEA*_*EAA 27

是的,oathtool可以做到这一点。您需要使用来自您的服务器的共享密钥为其播种。

您可以从oath-toolkit包中安装它。

  • 是的 - 使用 `--totp` 标志,它实现了与 Google Authenticator 相同的符合标准的 TOTP 算法。 (2认同)
  • 它是“誓言工具”。在许多情况下,您需要 `--totp` 和 `-b` 标志(base32 解码) (2认同)
  • FWIW,我为 oathtool 编写了一个 shell 包装器,其功能相当于 CLI 上的 Authy:https://github.com/poolpog/bash-otp (2认同)

Ada*_*rey 8

https://github.com/pcarrier/gauth 的github 上也有一个 go 实现

这个使用配置文件~/.config/gauth.csv以以下格式存储令牌

me@gmail.com: abcd efg hijk lmno
aws-account: mygauthtoken
Run Code Online (Sandbox Code Playgroud)

输出也相当友好:

$ gauth
           prev   curr   next
AWS        315306 135387 483601
Airbnb     563728 339206 904549
Google     453564 477615 356846
Github     911264 548790 784099
[=======                      ]
Run Code Online (Sandbox Code Playgroud)