git | ssh key认证失败问题

为Github账户设置SSH key

在添加完公钥之后, 遇到了下面这种问题:

[root@wdOS dtc2]# git clone git@github.com:xxxxx/dtc2
Cloning into 'Show'...
The authenticity of host 'github.com (192.30.255.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

说是主机密钥验证失败, 可以查看.ssh目录是否缺少了 known_hosts 文件, 而且必须生成 github.com 的ip执行内容. 如下:

[root@iZ94xpmg9boZ .ssh]# ssh git@github.com
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.

Permission denied (publickey).

然后 .ssh 目录里将是三个文件 . 这样就OK了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,359评论 19 139
  • 有必要先来了解什么是SSH和什么是SSH key。 SSH Secure Shell (SSH) 是一个允许两台电...
    faner阅读 47,805评论 1 48
  • SSH 为 Secure Shell 的缩写,由 IETF 的网络小组(Network Working Group...
    shuff1e阅读 5,733评论 1 11
  • 1、远程连接服务器 远程连接服务器对于管理员来说,是一个很有用的操作。它使得对服务器的管理更为方便。不过方便归方便...
    Zhang21阅读 39,672评论 0 20
  • 概述 SSH是(Secure SHell protocol) 的简写,安全外壳协议(SSH)是一种在不安全网络上提...
    技术学习阅读 54,045评论 9 41