我的ssh似乎现在只接受公钥认证。即使我确信我的/ etc/ssh/ssh_config中的“PasswordAuthentication”为yes。 这是我的SSH日志。我想知道为什么密码认证不允许在我的SSH? P.S:我可以通过在命令行中添加“-o PubkeyAuthentication = no”来强制ssh使用密码认证。为什么不允许密码验证?
[email protected]:~$ ssh -l lab 10.19.170.114 -v
OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /home/markz/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 10.19.170.114 [10.19.170.114] port 22.
debug1: Connection established.
debug1: identity file /home/markz/.ssh/id_rsa type -1
debug1: identity file /home/markz/.ssh/id_rsa-cert type -1
debug1: identity file /home/markz/.ssh/id_dsa type -1
debug1: identity file /home/markz/.ssh/id_dsa-cert type -1
debug1: identity file /home/markz/.ssh/id_ecdsa type -1
debug1: identity file /home/markz/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA d5:c0:00:1b:bf:54:56:a0:c6:68:6f:62:a4:1a:e3:e1
debug1: Host '10.19.170.114' is known and matches the ECDSA host key.
debug1: Found key in /home/markz/.ssh/known_hosts:10
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: [email protected]
Received disconnect from 10.19.170.114: 2: Too many authentication failures for lab
谢谢。是的,我的〜/ .ssh目录中有一些公钥,但根据我的理解,ssh不应该使用它们来尝试验证,除了id_rsa.pub。但无论如何,我认为你的建议是正确的,我会尝试。 – 2013-03-28 09:50:19
通过添加“Host * PubkeyAuthentication = no”,我可以登录到需要密码验证的服务器,但无法登录需要pubkey的服务器。 :( – 2013-03-29 03:53:54
好吧,我想通了,需要为需要pubkey认证的每个站点添加“PubkeyAuthentication yes”。 – 2013-03-29 04:02:13