git添加ssh公钥之后不能验证通过(码云/github)

weixin_38060280 2017-09-25 11:15:57
 开发四年只会写业务代码,分布式高并发都不会还做程序员?->>>    本地生成ssh key,将公钥添加到git服务商(码云/github)的设置页,这个过程之前已经进行过多次,没有问题。 然后验证,出现找不到本地key文件的错误 $ ssh -T git@gitee.com The authenticity of host 'gitee.com (120.55.226.24)' can't be established. ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc. ECDSA key fingerprint is MD5:27:e5:d3:f7:2a:9e:eb:6c:93💿1f:c1:47:a3:54:b1. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'gitee.com,120.55.226.24' (ECDSA) to the list of known hosts. sign_and_send_pubkey: signing failed: agent refused operation Permission denied (publickey). sxq @ sxq-fedora in ~ |23:09:43 $ eval "$(ssh-agent -s)" Agent pid 6871 sxq @ sxq-fedora in ~ |23:10:36 $ ssh-add Identity added: /home/sxq/.ssh/id_rsa (/home/sxq/.ssh/id_rsa) sxq @ sxq-fedora in ~ |23:10:38 $ ssh -T git@gitee.com ^CKilled by signal 2. sxq @ sxq-fedora in ~ |23:10:53 $ ssh -T git@gitee.com -v OpenSSH_7.5p1, OpenSSL 1.1.0f-fips 25 May 2017 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config debug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for * debug1: Connecting to gitee.com [120.55.226.24] port 22. debug1: Connection established. debug1: identity file /home/sxq/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /home/sxq/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.5 debug1: Remote protocol version 2.0, remote software version OSChina.NET debug1: no match: OSChina.NET debug1: Authenticating to gitee.com:22 as 'git' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: algorithm: curve25519-sha256@libssh.org debug1: kex: host key algorithm: ecdsa-sha2-nistp256 debug1: kex: server->client cipher: aes256-ctr MAC: hmac-sha1 compression: none debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha1 compression: none debug1: kex: curve25519-sha256@libssh.org need=32 dh_need=32 debug1: kex: curve25519-sha256@libssh.org need=32 dh_need=32 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc debug1: Host 'gitee.com' is known and matches the ECDSA host key. debug1: Found key in /home/sxq/.ssh/known_hosts:2 debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey after 4294967296 blocks debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/sxq/.ssh/id_rsa debug1: Server accepts key: pkalg ssh-rsa blen 535 debug1: Authentication succeeded (publickey). Authenticated to gitee.com ([120.55.226.24]:22). debug1: channel 0: new [client-session] debug1: Entering interactive session. debug1: pledge: network debug1: Sending environment. debug1: Sending env LANG = en_US.UTF-8 但是实际上是使用了的,服务器收到了请求,因为如果把验证地址改为github,那么在github上面显示有使用记录,网上看到的类似问题解决办法均不生效
...全文
484 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_38098983 2017-09-26
  • 打赏
  • 举报
回复
刚才在一个能正常使用的机器上实验了一把,前面都是一样的,后面结尾处有一点点差异 debug1: Sending environment. debug1: Sending env LC_MEASUREMENT = en_US.UTF-8 debug1: Sending env LC_PAPER = en_US.UTF-8 debug1: Sending env LC_MONETARY = en_US.UTF-8 debug1: Sending env LANG = en_US.UTF-8 debug1: Sending env LC_NUMERIC = en_US.UTF-8 debug1: Sending env LC_TIME = en_US.UTF-8 Welcome to Git@OSC, 阿信sxq! debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: channel 0: free: client-session, nchannels 1 Transferred: sent 2824, received 1408 bytes, in 0.2 seconds Bytes per second: sent 12499.1, received 6231.8 debug1: Exit status 0 到底是为什么呀。 仔细看日志,在两个地方,都显示和服务器是建立了通信的,了解的帮助以下啊
weixin_38107144 2017-09-26
  • 打赏
  • 举报
回复
问题里面的日志没贴全吧

472

社区成员

发帖
与我相关
我的任务
社区描述
其他技术讨论专区
其他 技术论坛(原bbs)
社区管理员
  • 其他技术讨论专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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