我正在运行 openssh 6.8p1,并尝试配置多种身份验证方法
它的工作原理
身份验证方法“公钥,密码”
但不是
身份验证方法“公钥,密码键盘交互:pam”
但是 sshd 无法启动。它给出了错误消息:
列表中存在未知的身份验证方法“密码键盘交互”
这是 /usr/sbin/sshd -ddd 的输出
debug2: load_server_config: filename /etc/ssh/sshd_config
debug2: load_server_config: done config len = 667
debug2: parse_server_config: config /etc/ssh/sshd_config len 667
debug3: /etc/ssh/sshd_config:1 setting Protocol 2
debug3: /etc/ssh/sshd_config:2 setting SyslogFacility AUTHPRIV
debug3: /etc/ssh/sshd_config:3 setting PermitRootLogin no
debug3: /etc/ssh/sshd_config:5 setting AuthorizedKeysFile /etc/ssh/authorized_keys
debug3: /etc/ssh/sshd_config:6 setting RevokedKeys /etc/ssh/revoked_keys
debug3: /etc/ssh/sshd_config:8 setting AuthenticationMethods "publickey,password keyboard-interactive:pam,password"
Unknown authentication method "password keyboard-interactive" in list
/etc/ssh/sshd_config line 8: invalid authentication method list.
这是我的 sshd 配置
Protocol 2
SyslogFacility AUTHPRIV
PermitRootLogin no
AuthorizedKeysFile /etc/ssh/authorized_keys
RevokedKeys /etc/ssh/revoked_keys
AuthenticationMethods "publickey,password keyboard-interactive:pam"
PasswordAuthentication yes
ChallengeResponseAuthentication yes
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
UsePAM yes
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE
AcceptEnv XMODIFIERS
X11Forwarding yes
Banner /etc/motd
Subsystem sftp /usr/libexec/openssh/sftp-server
答案1
我删除了参数周围的双引号身份验证方法,然后它就开始工作了。