我正在運行 openssh 6.8p1 並且我正在嘗試配置多種身份驗證方法
它的作品僅適用於
身份驗證方法“公鑰、密碼”
但不與
AuthenticationMethods“公鑰,密碼鍵盤互動: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
我刪除了參數周圍的雙引號認證方法,然後它就開始工作了。