github提示Permission denied (publi
2018-03-11 本文已影响0人
boyrt
当clone github某项目时,提示Permission denied (publickey),造成该错误的原因是未将本电脑的公私钥的公钥保存在github中。实现这一目的的主要分为两步:生成公私钥、配置公钥。
第一步:生成公私钥
通过命令生成公私钥
ssh-keygen -t rsa
命令执行后,一直Enter即可
公私钥保存默认路径:c:/Users/用户名/.ssh/
第二步:配置公钥
登录GIthub账号,settings菜单,

点击New SSH key
将.ssh/目录下的id_rsa.pub文件内容复制到key中。

点击Add SSH key 即可。