Permission denied (publickey). fatal: Could not read from remote repository.

问题:

新的账户没有添加公钥。

解决方法:

步骤一:账户下生成公钥和私钥

ssh-keygen -t rsa -C "yourmail@xxx.com"

该命令会在.ssh下生成如下两个文件:
Permission denied (publickey). fatal: Could not read from remote repository.
id_rsa是私钥,不能泄露出去。
id_ras.pub是公钥。

步骤二:

进入github个人账户setting中中找到这个。
Permission denied (publickey). fatal: Could not read from remote repository.
点击右上角这个
Permission denied (publickey). fatal: Could not read from remote repository.
将id_rsa.pub中的内容粘贴到Key中,Title名字可以自己起一个便于区分。然后点击Add SSH Key就行。之后就可以正常使用了。
Permission denied (publickey). fatal: Could not read from remote repository.

上一篇:vscode remote 远程开发 告别密码/免密码 登录


下一篇:一个项目同时需要向两个地址推送