![HP-UX 和 Linux Suse 之间的安全无密码 ssh 配置](https://linux22.com/image/610120/HP-UX%20%E5%92%8C%20Linux%20Suse%20%E4%B9%8B%E9%97%B4%E7%9A%84%E5%AE%89%E5%85%A8%E6%97%A0%E5%AF%86%E7%A0%81%20ssh%20%E9%85%8D%E7%BD%AE.png)
我已经验证了权限(.ssh 为 700,./ssh/* 为 600),检查了文件 sshd_config 的配置,但服务器继续要求输入密码,这是日志:
nomgmpr@psoftn $ ssh -vvv [email protected]
OpenSSH_5.9p1+sftpfilecontrol-v1.3-hpn13v12, OpenSSL 0.9.8q 2 Dec 2010
HP-UX Secure Shell-A.05.90.003, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to 130.172.152.194 [130.172.152.194] port 22.
debug1: Connection established.
debug1: identity file /psdb/.ssh/identity type -1
debug1: identity file /psdb/.ssh/identity-cert type -1
debug3: Incorrect RSA1 identifier
debug3: Could not load "/psdb/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /psdb/.ssh/id_rsa type 1
debug1: identity file /psdb/.ssh/id_rsa-cert type -1
debug1: identity file /psdb/.ssh/id_dsa type -1
debug1: identity file /psdb/.ssh/id_dsa-cert type -1
debug1: identity file /psdb/.ssh/id_ecdsa type -1
debug1: identity file /psdb/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1
debug1: match: OpenSSH_5.1 pat OpenSSH*
debug1: Remote is NON-HPN aware
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1+sftpfilecontrol-v1.3-hpn13v12
debug2: fd 4 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "130.172.152.194" from file "/psdb/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /psdb/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],ssh-rsa-cert- [email protected],ssh-rsa
debug3: RNG is ready, skipping seeding
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: AUTH STATE IS 0
debug2: kex_parse_kexinit: 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-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],ssh-rsa,[email protected],[email protected],[email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128- cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,[email protected],aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: REQUESTED ENC.NAME is 'aes128-ctr'
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 122/256
debug2: bits set: 504/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 2f:6b:0b:9c:27:e3:64:26:d7:7c:dd:87:de:db:de:27
debug3: load_hostkeys: loading entries for host "130.172.152.194" from file "/psdb/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /psdb/.ssh/known_hosts:5
debug3: load_hostkeys: loaded 1 keys
debug1: Host '130.172.152.194' is known and matches the RSA host key.
debug1: Found key in /psdb/.ssh/known_hosts:5
debug2: bits set: 525/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /psdb/.ssh/identity (0)
debug2: key: /psdb/.ssh/id_rsa (6000000000059270)
debug2: key: /psdb/.ssh/id_dsa (0)
debug2: key: /psdb/.ssh/id_ecdsa (0)
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /psdb/.ssh/identity
debug3: no such identity: /psdb/.ssh/identity
debug1: Offering RSA public key: /psdb/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /psdb/.ssh/id_dsa
debug3: no such identity: /psdb/.ssh/id_dsa
debug1: Trying private key: /psdb/.ssh/id_ecdsa
debug3: no such identity: /psdb/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:
你能帮我提供一些建议吗?
答案1
如果您有权访问服务器,则更重要的帮助可能来自服务器端。在服务器端,停止 sshd。如果服务器端是 HP-UX,/sbin/init.d/secsh stop
将为您执行此操作。然后,您需要使用命令以调试模式启动 sshd /usr/sbin/sshd -ddd
。此时,请确保没有其他人通过 ssh 访问此计算机,因为调试模式下的 sshd 只允许一个传入连接。
然后,您转到 Linux 计算机并发出命令ssh -vvv hpux_server
。此时,并排比较调试输出。我确信,您很快就会发现问题出在哪里。我敢打赌,私钥和公钥 ssh 不匹配,这是由于文件格式造成的,但我当然也可能是错的。
如果您不明白,请发布客户端和服务器的调试输出,以供大家查看。