这个错误信息表明在尝试与远程 Git 存储库通信时遇到了 SSH 认证问题。错误中的 “Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)” 提示了可能的认证方式,而 “Could not read from remote repository” 则说明了连接远程仓库时发生的问题。
依然是因为macOS好久没有更新升级过了,操作了升级macOS后出现的问题
在gitLab页面新建了一个分支,现在需要在本地切换并关联到远程分支,第一步根据远程分支建立本地分支就gg了
idea命令行输入如下
git fetch origin 远程分支名x:本地分支名x
结果需要我输入密码,之前可是没有输入过密码的,结果输入三次密码还都没有对
于是乎报错了(输入密码感觉不正常了),如下
git@git.**: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
需要在 .ssh/config 增加一些配置才行
.ssh文件一般是在用户目录下
cd ~/.ssh
已经存在该文件的话则不需要创建
touch config
Host *
IdentityFile ~/.ssh/id_rsa # 写明 key 的位置
HostkeyAlgorithms +ssh-rsa # 使 openssh 支持 rsa 算法
PubkeyAcceptedAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
再次执行命令则没有问题了,解决了
看到有些说法是有些mac 系统不支持 rsa 算法,不确定是否为根本原因(一般系统升级应该都会兼容的啊),但还未深究其因
可能的原因包括:
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有