ssh配好无密码登录(RSA公钥)后,还要密码登录的问题的解决思路

http://blog.chinaunix.net/uid-670018-id-2077065.html

  
    对ssh使用 -v 参数debugv发现已经公钥授权已经通过,但接下来还是采用密码认证。百思不得其解。于是在网上查,好多人都遇到了这个问题,也有很多的解决方法,但每一个都试过了就是不行。
  • 方法一:改.ssh目录的权限为700      无效
  • 方法二:重新生成密钥               无效
  • 方法三:修改sshd_config里的选项    无效
  • 方法四:把可以登录的机器上的和ssh
     相关文件按原权限拷贝到本地         无效
  • 最后想到可能中途拷错,对所有的相关文件md5发现是一样的,很无语.......
    无意中发现这台机器配了samba并把root目录做了samba映射,可能是为了方便把root目录的权限改成了777。我当时用samba也很容易出现权限问题,当时也是用这种很“暴力”的方法解决的,但我不是对/root目录是对其下的一个小目录。想到/root目录在Linux上是有较强的安全管理规则的。可能是这个出了问题。对root改回650,再次测试成功通过。心喜!
    网上的大多数此类问题都是配置和授权问题,改sshd_config文件的居多。这次遇到的这个问题很少见,但解决问题的方法可以提炼一下。当觉得问题无解时,不妨休息一下换个思路,

展开阅读全文

ssh远程无密码登录问题

02-22

新手问题..rn还是会提示要输入密码,不是权限的问题,实在百度不出来 请教各位大神.. rnrnmaster@master:~/.ssh$ ssh -vv node2rnOpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 19: Applying options for *rndebug2: ssh_connect: needpriv 0rndebug1: Connecting to node2 [192.168.63.132] port 22.rndebug1: Connection established.rndebug1: identity file /home/master/.ssh/id_rsa type -1rndebug1: identity file /home/master/.ssh/id_rsa-cert type -1rndebug1: identity file /home/master/.ssh/id_dsa type 2rndebug1: identity file /home/master/.ssh/id_dsa-cert type -1rndebug1: identity file /home/master/.ssh/id_ecdsa type -1rndebug1: identity file /home/master/.ssh/id_ecdsa-cert type -1rndebug1: identity file /home/master/.ssh/id_ed25519 type -1rndebug1: identity file /home/master/.ssh/id_ed25519-cert type -1rndebug1: Enabling compatibility mode for protocol 2.0rndebug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8rndebug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8rndebug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 pat OpenSSH_6.6.1* compat 0x04000000rndebug2: fd 3 setting O_NONBLOCKrndebug1: SSH2_MSG_KEXINIT sentrndebug1: SSH2_MSG_KEXINIT receivedrndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1rndebug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-ed25519,ssh-rsa,ssh-dssrndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.serndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.serndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96rndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96rndebug2: kex_parse_kexinit: none,zlib@openssh.com,zlibrndebug2: kex_parse_kexinit: none,zlib@openssh.com,zlibrndebug2: kex_parse_kexinit: rndebug2: kex_parse_kexinit: rndebug2: kex_parse_kexinit: first_kex_follows 0 rndebug2: kex_parse_kexinit: reserved 0 rndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1rndebug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519rndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.serndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.serndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96rndebug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96rndebug2: kex_parse_kexinit: none,zlib@openssh.comrndebug2: kex_parse_kexinit: none,zlib@openssh.comrndebug2: kex_parse_kexinit: rndebug2: kex_parse_kexinit: rndebug2: kex_parse_kexinit: first_kex_follows 0 rndebug2: kex_parse_kexinit: reserved 0 rndebug2: mac_setup: setup hmac-md5-etm@openssh.comrndebug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com nonerndebug2: mac_setup: setup hmac-md5-etm@openssh.comrndebug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com nonerndebug1: sending SSH2_MSG_KEX_ECDH_INITrndebug1: expecting SSH2_MSG_KEX_ECDH_REPLYrndebug1: Server host key: ECDSA b1:41:8a:0b:60:f6:1c:c0:46:07:5d:c8:bc:1f:48:dbrndebug1: Host 'node2' is known and matches the ECDSA host key.rndebug1: Found key in /home/master/.ssh/known_hosts:2rndebug1: ssh_ecdsa_verify: signature correctrndebug2: kex_derive_keysrndebug2: set_newkeys: mode 1rndebug1: SSH2_MSG_NEWKEYS sentrndebug1: expecting SSH2_MSG_NEWKEYSrndebug2: set_newkeys: mode 0rndebug1: SSH2_MSG_NEWKEYS receivedrndebug1: SSH2_MSG_SERVICE_REQUEST sentrndebug2: service_accept: ssh-userauthrndebug1: SSH2_MSG_SERVICE_ACCEPT receivedrndebug2: key: /home/master/.ssh/id_dsa (0xb9676498),rndebug2: key: /home/master/.ssh/id_rsa ((nil)),rndebug2: key: /home/master/.ssh/id_ecdsa ((nil)),rndebug2: key: /home/master/.ssh/id_ed25519 ((nil)),rndebug1: Authentications that can continue: publickey,passwordrndebug1: Next authentication method: publickeyrndebug1: Offering DSA public key: /home/master/.ssh/id_dsarndebug2: we sent a publickey packet, wait for replyrndebug1: Authentications that can continue: publickey,passwordrndebug1: Trying private key: /home/master/.ssh/id_rsarndebug1: Trying private key: /home/master/.ssh/id_ecdsarndebug1: Trying private key: /home/master/.ssh/id_ed25519rndebug2: we did not send a packet, disable methodrndebug1: Next authentication method: passwordrnmaster@node2's password: 论坛

没有更多推荐了,返回首页