OpenSSH 服务器:如何配置键盘交互认证

Mik*_* L. 8 ssh authentication ubuntu

如何配置 OpenSSH 服务器(在 Ubuntu 上)以允许键盘交互但不允许密码身份验证?

我知道公钥身份验证是首选,但我想测试用户设置。

Cod*_*ome 7

您需要配置 PAM 以用于 OPIE 或 OTPW,具体取决于您的 Ubuntu 版本。一旦您拥有一次性密码系统并通过/etc/pam.d/sshd模块正确配置,您就可以设置 SSH 以使用它。

# /etc/ssh/sshd_config
PasswordAuthentication no
ChallengeResponseAuthentication yes
Run Code Online (Sandbox Code Playgroud)

更改配置文件后不要忘记重新加载SSH;否则,您的更改将不会生效。


Rob*_*ell 5

ChallengeResponseAuthentication=yes 
Run Code Online (Sandbox Code Playgroud)

在你的 sshd.conf