ssh 用rsa和dsa无法验证的问题

mooncat2000 2011-05-09 11:20:24
贴段日志,有高人帮忙看看么

密钥是客户端生成后拷贝过去的
home .ssh key文件目录权限也检查了
为啥验证通不过呢


:57:30 app sshd[20498]: debug3: mm_request_send entering: type 24
May 9 22:57:30 app sshd[20498]: debug3: mm_getpwnamallow: waiting for MONITOR_ANS_PWNAM
May 9 22:57:30 app sshd[20497]: debug3: monitor_read: checking request 24
May 9 22:57:30 app sshd[20498]: debug3: mm_request_receive_expect entering: type 25
May 9 22:57:30 app sshd[20497]: debug3: mm_answer_pwnamallow
May 9 22:57:30 app sshd[20498]: debug3: mm_request_receive entering
May 9 22:57:30 app sshd[20497]: debug3: auth_shadow_acctexpired: today 15103 sp_expire -1 days left -15104
May 9 22:57:30 app sshd[20497]: debug3: account expiration disabled
May 9 22:57:30 app sshd[20497]: debug3: mm_answer_pwnamallow: sending MONITOR_ANS_PWNAM: 1
May 9 22:57:30 app sshd[20497]: debug3: mm_request_send entering: type 25
May 9 22:57:31 app sshd[20498]: debug2: input_userauth_request: setting up authctxt for git
May 9 22:57:31 app sshd[20497]: debug2: monitor_read: 24 used once, disabling now
May 9 22:57:31 app sshd[20498]: debug3: mm_inform_authserv entering
May 9 22:57:31 app sshd[20497]: debug3: mm_request_receive entering
May 9 22:57:31 app sshd[20498]: debug3: mm_request_send entering: type 20
May 9 22:57:31 app sshd[20498]: debug3: mm_inform_authrole entering
May 9 22:57:31 app sshd[20497]: debug3: monitor_read: checking request 20
May 9 22:57:31 app sshd[20498]: debug3: mm_request_send entering: type 21
May 9 22:57:31 app sshd[20497]: debug3: mm_answer_authserv: service=ssh-connection, style=
May 9 22:57:31 app sshd[20498]: debug2: input_userauth_request: try method none
May 9 22:57:31 app sshd[20497]: debug2: monitor_read: 20 used once, disabling now
May 9 22:57:31 app sshd[20498]: debug1: userauth-request for user git service ssh-connection method publickey
May 9 22:57:31 app sshd[20497]: debug3: mm_request_receive entering
May 9 22:57:31 app sshd[20498]: debug1: attempt 1 failures 1
May 9 22:57:31 app sshd[20497]: debug3: monitor_read: checking request 21
May 9 22:57:31 app sshd[20498]: debug2: input_userauth_request: try method publickey
May 9 22:57:31 app sshd[20497]: debug3: mm_answer_authrole: role=
May 9 22:57:31 app sshd[20498]: debug1: test whether pkalg/pkblob are acceptable
May 9 22:57:31 app sshd[20497]: debug2: monitor_read: 21 used once, disabling now
May 9 22:57:31 app sshd[20498]: debug3: mm_key_allowed entering
May 9 22:57:31 app sshd[20497]: debug3: mm_request_receive entering
May 9 22:57:31 app sshd[20498]: debug3: mm_request_send entering: type 38
May 9 22:57:31 app sshd[20498]: debug3: mm_key_allowed: waiting for MONITOR_ANS_KEYALLOWED
May 9 22:57:31 app sshd[20497]: debug3: monitor_read: checking request 38
May 9 22:57:31 app sshd[20498]: debug3: mm_request_receive_expect entering: type 39
May 9 22:57:31 app sshd[20497]: debug3: mm_answer_keyallowed entering
May 9 22:57:31 app sshd[20498]: debug3: mm_request_receive entering
May 9 22:57:31 app sshd[20497]: debug3: mm_answer_keyallowed: key_from_blob: 0x94a0008
May 9 22:57:31 app sshd[20497]: debug1: temporarily_use_uid: 501/501 (e=0/0)
May 9 22:57:31 app sshd[20497]: debug1: trying public key file /home/git/.ssh/authorized_keys
May 9 22:57:31 app sshd[20497]: debug1: restore_uid: 0/0
May 9 22:57:31 app sshd[20497]: debug1: temporarily_use_uid: 501/501 (e=0/0)
May 9 22:57:31 app sshd[20497]: debug1: trying public key file /home/git/.ssh/authorized_keys2
May 9 22:57:31 app sshd[20497]: debug1: restore_uid: 0/0
May 9 22:57:31 app sshd[20497]: Failed publickey for git from 116.xx.xx.xx port 51943 ssh2
May 9 22:57:31 app sshd[20497]: debug3: mm_answer_keyallowed: key 0x94a0008 is disallowed
May 9 22:57:31 app sshd[20497]: debug3: mm_request_send entering: type 39
May 9 22:57:31 app sshd[20497]: debug3: mm_request_receive entering
May 9 22:57:31 app sshd[20498]: debug2: userauth_pubkey: authenticated 0 pkalg ssh-rsa
...全文
3839 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
mooncat2000 2011-05-11
  • 打赏
  • 举报
回复
搞清楚了还是权限的问题 照下面做了 就好了

Thank you all so much for your suggestions and very helpful hints. I can't say exactly what I changed, but the ssh sessions are now password free. I'm made sure that the user home dir is 755 as is the ~/.ssh. The public keys files and the authorization file are 644. The private key files are 600.

While debugging some other issues on the systems, I cleaned up a bunch of things regarding my /etc/passwd, /etc/shadow, /etc/group, /etc/gshadow file. I can't help but to wonder if that may have improved the situation as well.

Regardsless, I can now move onto step two using rsync or rdist in a cron job to keep distributed files in sync.

Thanks again!!!!
steptodream 2011-05-10
  • 打赏
  • 举报
回复
你不会是拿rsa的密钥去和dsa的公钥认证吧? 你采用一种就行了嘛 要么用rsa 要么用dsa试试 不要一起来或者混着来。

csdn又出问题了 老是404
steptodream 2011-05-10
  • 打赏
  • 举报
回复
你不会是拿rsa的密钥去和dsa的公钥认证吧? 你采用一种就行了嘛 要么用rsa 要么用dsa试试 不要一起来或者混着来。

csdn又出问题了 老是404
steptodream 2011-05-10
  • 打赏
  • 举报
回复
你不会是拿rsa的密钥去和dsa的公钥认证吧? 你采用一种就行了嘛 要么用rsa 要么用dsa试试 不要一起来或者混着来。
mooncat2000 2011-05-09
  • 打赏
  • 举报
回复
客户端:

OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 116.66.37.24 [116.66.37.24] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug3: Not a RSA1 key file /root/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /root/.ssh/id_rsa type 1
debug3: Not a RSA1 key file /root/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /root/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: 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,rijndael-cbc@lysator.liu.se,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,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,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-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,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,rijndael-cbc@lysator.liu.se
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,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc 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: 120/256
debug2: bits set: 537/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /root/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host '116.xx.xx.xx' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug2: bits set: 499/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: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /root/.ssh/identity ((nil))
debug2: key: /root/.ssh/id_rsa (0x90953d0)
debug2: key: /root/.ssh/id_dsa (0x90953e8)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-with-mic,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: /root/.ssh/identity
debug3: no such identity: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: /root/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
git@116.xx.xx.xx's password:

19,613

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧