我有一个非常广泛的.ssh/config文件,其中包含一些条目,如:
Host gitlab.com
Preferredauthentications publickey
HostName gitlab.com
User git
IdentityFile ~/.ssh/gitlab.pub
IdentitiesOnly yes我还使用SSH代理提供私钥。现在,当我在VSCode中使用这个设置时,容器似乎不知道配置文件。我遇到了这样的错误:
Received disconnect from 172.65.251.78 port 22:2: Too many authentication failures
Disconnected from 172.65.251.78 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.通过在容器中运行GIT_SSH_COMMAND="ssh -v" git fetch,我发现所有的键都试过了,在5次尝试之后,Gitlab服务器不想继续。因此ssh代理被转发到容器,而不是配置文件。在容器外,一切都很顺利。
有人有办法解决这个问题吗?
我的环境:
Version: 1.53.0
Commit: 8490d3dde47c57ba65ec40dd192d014fd2113496
Date: 2021-02-03T15:56:04.185Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Linux x64 5.10.13-arch1-2
Remote-Containers: v0.158.0发布于 2021-02-14 00:24:56
IdentityFile ~/.ssh/gitlab.pub这似乎是错误的:通常情况下,IdentityFile引用的是私有SSH密钥,而不是公共密钥:
IdentityFile ~/.ssh/gitlabhttps://stackoverflow.com/questions/66098833
复制相似问题