通过 git clone 拉取代码时,出现了以下问题:
The authenticity of host 'github.com' can't be established. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.2. 原因
我新买的电脑还没有配置 GitHub ssh 公钥。
3. 解决-
ssh -T git@github.com 检验是否配置了GitHub SSH公钥。如果提示 **git@github.com: Permission denied (publickey).**则表示没有配置到SSH。
-
ssh-keygen -t rsa -C "321******@qq.com" 生成SSH。最后的邮箱是绑定了自己GitHub账号的邮箱。
* cat ~/.ssh/id_rsa.pub 查看公钥文件内容。
全选复制公有秘钥,然后粘贴到GitHub–> Settings–> SSH and GPG keys --> New SSH key。
在终端验证是否配置成功,配置成功如下:
完毕。



