我使用的是 Ubuntu 14.04.1(使用 OpenSSH 6.6 和 libpam-google-authenticator 20130529-2)。
我正在尝试设置 SSH 登录,其中公钥进行身份验证(没有密码),并提示用户输入来自 Google 身份验证器的代码。
遵循/调整这些说明后,我收到了密码提示和 Google 身份验证提示:
我已经安装了软件包,编辑了我的/etc/ssh/sshd_config
和/etc/pam.d/ssh
文件
在/etc/ssh/sshd_config
:
ChallengeResponseAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
UsePAM yes
Run Code Online (Sandbox Code Playgroud)
并在底部/etc/pam.d/ssh
:
auth required pam_google_authenticator.so nullok # (I want to give everyone a chance to set up their 2FA before removing "nullok")
Run Code Online (Sandbox Code Playgroud)
我知道 PAM 是顺序相关的,但sshd_config
也是?
我究竟做错了什么?任何帮助,将不胜感激。