没有密码的SSH登录失败

时间:2014-05-07 12:11:56

标签: linux ubuntu ssh

我按照post进行无需密码的SSH登录,它可以工作一段时间,但现在我无法自动登录。

ssh -v -p 10022 leo@cassandra

Error:
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to cassandra [172.18.101.112] port 10022.
debug1: Connection established.
debug1: identity file /home/leo/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/leo/.ssh/id_rsa-cert type -1
debug1: identity file /home/leo/.ssh/id_dsa type -1
debug1: identity file /home/leo/.ssh/id_dsa-cert type -1
debug1: identity file /home/leo/.ssh/id_ecdsa type -1
debug1: identity file /home/leo/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
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 57:8a:49:c6:88:90:f8:b0:94:c5:f9:eb:2f:34:9e:76
debug1: Host '[cassandra]:10022' is known and matches the ECDSA host key.
debug1: Found key in /home/leo/.ssh/known_hosts:1
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: /home/leo/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/leo/.ssh/id_dsa
debug1: Trying private key: /home/leo/.ssh/id_ecdsa
debug1: Next authentication method: password


My PC:
drwx------  2 leo leo  4096 May  7 19:56 .ssh
-rw-------  1 leo leo 1766 May  7 19:55 id_rsa
-rw-r--r--  1 leo leo  444 May  7 19:56 known_hosts
-rw-r--r--  1 leo leo  407 May  7 19:55 id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIu4NxzrlOgv4P82cw6u4PokzRWcWlx31n2BBuYg1KU0QLfqe5kCeJabN405qhwRzZjUCxbWeRvWVUPcnnNKgpj0+2wJtW4Bjt0HjWWj+R6gNxdrQQeioOBynopeIPKBzKcwnzBcbHKQQWEKTWFb+MFDF9EOK0sliD2Dsdm
p87IjKe24/jmNRX+7tCeux0whnFWsbfjOhZ4AGzGWTAHWY2gdVSH3T4hCY4e/BRf7VSCLV9ijyzcI6e82ZuXlZCCIGg/maP6QV1CXhpbQKtui07Lm8GcrUwwn8KYZEKHSMZTmBpVIeryKtmtrQ0SfT5tlOQ1g5IzQRryjxZvqOH597/ leo@kai-PC

Remote:
drwxrwxr-x 2 leo leo  4096 May  7 19:59 .ssh
-rw-rw-r-- 1 leo leo  407 May  7 19:59 authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIu4NxzrlOgv4P82cw6u4PokzRWcWlx31n2BBuYg1KU0QLfqe5kCeJabN405qhwRzZjUCxbWeRvWVUPcnnNKgpj0+2wJtW4Bjt0HjWWj+R6gNxdrQQeioOBynopeIPKBzKcwnzBcbHKQQWEKTWFb+MFDF9EOK0sliD2Dsdm
p87IjKe24/jmNRX+7tCeux0whnFWsbfjOhZ4AGzGWTAHWY2gdVSH3T4hCY4e/BRf7VSCLV9ijyzcI6e82ZuXlZCCIGg/maP6QV1CXhpbQKtui07Lm8GcrUwwn8KYZEKHSMZTmBpVIeryKtmtrQ0SfT5tlOQ1g5IzQRryjxZvqOH597/ leo@kai-PC

我不熟悉ssh的身份验证协议,有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

从您的输出中,远程计算机对.ssh目录上的组具有写入权限。

您需要从.ssh目录和主目录中删除远程计算机上所有者以外的任何人的写入权限。 https://askubuntu.com/questions/54670/passwordless-ssh-not-working