python - VS Code 源代码控制功能在远程身份验证上失败
问题描述
问题:
由于身份验证问题,无法在 VS Code 上使用源代码管理功能
设置:
在 Windows 笔记本电脑上编辑,然后通过 VS Code 的 SSH 扩展远程连接到 linux 服务器。Git repo 是在 linux 服务器上设置的。我能够推/拉/等等。通过命令行到 repo,但源代码控制功能失败。出现以下错误:
Permission denied, please try again.
Permission denied, please try again.
git@[company gitlab domain]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
我试图重新生成 SSH 密钥,但这并没有解决问题。Windows 中的凭据也设置正确。
解决方案
Windows 中的凭据也设置正确。
如果通过“凭据”,您正在谈论缓存在 中的用户名/密码git config credential.helper
,那根本无助于 SSH,因为这仅用于 HTTPS URL。
我能够推/拉/等等。通过命令行到 repo,但源代码控制功能失败。
从 Linux 服务器的命令行仔细检查该 Git 存储库的根文件夹中的远程 eURL:
git remote origin
确保它是 SSH 的
您可以将其替换为:
gl:<me>/<myrepo>
在gl
远程帐户中设置了一个条目~/.ssh/config
Host gl
Hostname: [company gitlab domain]
User: git
IdentityFile: /home/aUser/.ssh/aKey
推荐阅读
- queue - NiFi - 处理后的 JMS 确认
- jenkins - 关于管道语法的 Kubernetes Jenkins 插件问题
- arduino - Arduino异常第二次运行串行
- hadoop - Hive 连接因错误而关闭
- css - 如何用css实现手机上video的width=device的width,电脑上video的width=600px的html
- sql - 如何根据其他列值创建序列
- docker - 我正在尝试在 centos8 vagrantbox 上安装 docker,但遇到错误“下载成功,但校验和不匹配”
- c# - 尝试在迭代中运行 100 个并行任务不起作用
- typescript - 导出类型的打字稿问题
- c# - 使用 DataContractJsonSerializer 序列化时出现 InvalidDataContractException