OpenSSH 需要密码和公钥

OpenSSH 需要密码和公钥

我继承了一个安装了 OpenSSH 5.3 的旧 CentOS-6 系统。 OpenSSH 的行为很奇怪:当前守护进程需要使用公钥用于登录的密码。 (从我记事起,一直都是这样。)现在我需要能够仅使用密码登录或者一把钥匙——但是不是两个都!

我已经验证这些设置是在守护进程上配置的:

[root@cp ~]# grep -v '#' /etc/ssh/sshd_config | grep -v ^$
Protocol 2
SyslogFacility AUTHPRIV
PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication yes
ChallengeResponseAuthentication yes
GSSAPIAuthentication no
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
UseDNS no
Subsystem   sftp    /usr/libexec/openssh/sftp-server
AllowUsers eric@*
AllowUsers techsup@*
   <<<snip>>>

我检查过/var/log/secure。并发现这两行登录成功后:

Feb  6 22:33:21 cp sshd[28717]: Accepted keyboard-interactive/pam for root from X.X.X.X port 25075 ssh2
Feb  6 22:33:21 cp sshd[28717]: pam_unix(sshd:session): session opened for user root by (uid=0)

我尝试过调试登录过程。和这很突出:

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/eric/.ssh/id_rsa RSA SHA256:Z2LEkZcy7/ntslBfeMFMh0WoOdt9xneuXX9VMSYv4VU agent
debug1: send_pubkey_test: no mutual signature algorithm
debug1: Offering public key: /home/eric/.ssh/id_ed25519 ED25519 SHA256:SjsJwvjUB3dVgurbsHTPooUOsGchvHGaYHy3VRS7who agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /home/eric/.ssh/id_rsa RSA SHA256:pDRJBoQKu0Ast8ypN15C6moeZ6I7lOawnj3IIgkFNjM agent
debug1: send_pubkey_test: no mutual signature algorithm

如何禁用此行为以便我可以使用密码登录或者关键?

TIA,

埃里克·普雷托里斯

内华达州里诺

相关内容