git报错:[email protected]: Permission denied (publickey)
程序员文章站
2022-07-13 16:11:47
...
$ ssh -T aaa@qq.com
aaa@qq.com: Permission denied (publickey).
今天在git命令窗口测试【码云】连不上,按照网上找的方法说是公钥配置的有问题,重新配置一遍还是有问题。
如果按照网上的那种配置方法搞不定,照我的方法配置基本就差不多了。
最后还是加了一个参数 -v ssh -T -v aaa@qq.com 查看用以上命令访问【码云】具体做了哪些操作
ps: 大家调试shell 时老是报错,也可以加上一个-x 如 sh -x demo.sh就会列出执行脚本的一些信息
从上图可以看出,找的是默认的id_rsa
因为我配置了github和码云 将**是独立命名的 ,导致访问失败,红色为码云的密码,黄色为github的**
解决办法:
在**目录下新建一个文件:
vi config
# gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee_id_rsa
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa
效果图:
推荐阅读
-
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
-
git clone报错:Permission denied (publickey). fatal: Could not read from remote repository...
-
git clone出现Permission denied (publickey)解决办法
-
Git报错解决:[email protected]: Permission denied (publickey).
-
git报错:[email protected]: Permission denied (publickey)
-
vscode 连远程服务器报错 Permission denied (publickey)
-
IDEA中使用git报错Permission denied (publickey)
-
linux git clone 仓库报错: Permission denied (publickey)
-
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
-
git clone时报错Permission denied (publickey,password)