天天看点

git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.

问题

本地的git拉取github远程仓库到本地报错信息如下:

git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.

解决

git config --global user.email 你的邮箱
git      

1、输入​

​ls -al ~/.ssh​

git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.

2、输入​

​ssh-keygen -t rsa -C "自己的github账号"​

​,然后回车3次

  • key生成成功后用户主目录生成.ssh文件夹。
  • id_rsa是私钥,id_rsa.pub是公钥。
  • git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.
  • 3、查看ssh-key:​

    ​cat ~/.ssh/id_rsa.pub​

  • git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.
  • 4、复制ssh-key到github上的,秘钥信息以​

    ​ssh-rsa​

    ​开始,邮箱结束的
  • 登录github,找到Settings=>SSH and GPG keys设置。
  • 点击New SSH key,Title输入框随意,Key输入框填入公钥的内容
  • git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.
    git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.
  • 5、测试是否成功:​

    ​ssh -T [email protected]

git提示:The authenticity of host ‘github.com (13.229.188.59)‘ can‘t be established.