首页 > 解决方案 > 在 Fedora 33 中,使用 ssh id_rsa 文件的 git 操作在 GitLab.com 上失败

问题描述

由于我安装了 Fedora 33,任何使用 GitLab.com 的 git 操作(以及不同的症状,天蓝色)都会失败。在 GitLab.com 上,我得到:

git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Azure 只要求输入密码,而不会显示任何错误。

标签: gitsshazure-devopsgitlab

解决方案


正如这里所建议的, gitlab 的修复方法是将这些行保存在~/.ssh/config文件中:

Host gitlab.com
    HostName gitlab.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_rsa
    PubkeyAcceptedKeyTypes=+ssh-rsa

对于 Azure,将出现的两个更改gitlab.comssh.dev.azure.com


推荐阅读