Git 不使用 SSH 密钥对 Azure DevOps 进行身份验证

Pre*_*red 1 git ssh bash github azure

我最近切换到新安装的 Fedora 33 Silverblue 运行工具箱。这也发生在工具箱之外。我使用以下命令生成了 SSH 密钥

\n
ssh-keygen -t rsa -b 4096 -C filbot@fenix\n
Run Code Online (Sandbox Code Playgroud)\n

然后我将其上传到我的帐户下的Azure DevOps。但是,我无法使用以下内容从 Azure DevOps 克隆任何内容~/.ssh/config

\n
\xe2\xac\xa2[filbot@toolbox ~]$ cat ~/.ssh/config \n# SSH Configuration File\nHost ssh.dev.azure.com\n  HostName ssh.dev.azure.com\n  User git\n  IdentityFile /var/home/filbot/.ssh/id_rsa\n  IdentitiesOnly yes\nHost vs-ssh.visualstudio.com\n  HostName vs-ssh.visualstudio.com\n  User git\n  IdentityFile /var/home/filbot/.ssh/id_rsa\n  IdentitiesOnly yes\n
Run Code Online (Sandbox Code Playgroud)\n

然后我运行这些git clone命令,结果如下:

\n
\xe2\xac\xa2[filbot@toolbox ~]$ cat ~/.ssh/config \n# SSH Configuration File\nHost ssh.dev.azure.com\n  HostName ssh.dev.azure.com\n  User git\n  IdentityFile /var/home/filbot/.ssh/id_rsa\n  IdentitiesOnly yes\nHost vs-ssh.visualstudio.com\n  HostName vs-ssh.visualstudio.com\n  User git\n  IdentityFile /var/home/filbot/.ssh/id_rsa\n  IdentitiesOnly yes\n
Run Code Online (Sandbox Code Playgroud)\n

看起来 Git 并没有像以前或在 Fedora 或 Pop!_OS 的其他旧安装中那样尊重甚至使用我的主目录中的 ssh 配置。我不明白为什么现在要这样做,以及如何获取信息以进一步了解这一点。

\n

Mat*_* S. 7

我遇到了完全相同的问题,并在这里找到了解决方案:

Fedora 33 git pull 或克隆不再工作和/或 ssh 密钥不再被识别

基本上,在您的文件中的每个部分~/.ssh/config下,添加.HostPubkeyAcceptedKeyTypes ssh-rsa

Host ssh.dev.azure.com
  HostName ssh.dev.azure.com
  User git
  IdentityFile /var/home/filbot/.ssh/id_rsa
  IdentitiesOnly yes
  PubkeyAcceptedKeyTypes ssh-rsa
Run Code Online (Sandbox Code Playgroud)