主机密钥验证失败 - 在 macOS 上使用 Visual Studio 代码的 GitLab
Host Key Verification Failed - GitLab with Visual Studio Code on macOS
在尝试将更改推送到 git 控制的 folder/project 到 Gitlab 时,我不断收到 "Host Key Verification Failed" 错误。无论出于何种原因,使用 Visual Studio for Mac 都可以正常工作,我可以通过网络浏览器登录到我的 Gitlab 帐户。
通过删除 ~/.ssh/ 中的 any/all Known_hosts 文件然后在终端中执行 ssh git@gitlab.com
并回答 "yes"(重新添加 git@gitlab.com 到 known_hosts 重新创建一个新的 known_hosts 文件后)。
我在 known_hosts 中做了一些乱七八糟的事情,这可能导致了问题。
我在 git 中为 Windows 重新创建了 ssh 密钥并且成功了!
我发现我的家庭资料在 git bash 中加载为 "P:\"(因为我工作的 IT 团队...)。
确保在 git bash 中您已经使用 ssh-keygen
生成了一个 ssh 密钥并且 GitLab 知道该密钥。
如果问题仍然存在,运行 ssh -o StrictHostKeyChecking=no <gitlab-host> uptime
让 gitlab 可信。
在 Windows 中,我在 MS Visual Studio 代码上从 Git 收到此错误。
我必须从 Git Bash 启动它以引入我的 git 和 ssh 环境配置。
<your git bash prompt> $ Code
VS Code 应该会启动,然后您应该可以通过 ssh 克隆一个 repo。
在尝试将更改推送到 git 控制的 folder/project 到 Gitlab 时,我不断收到 "Host Key Verification Failed" 错误。无论出于何种原因,使用 Visual Studio for Mac 都可以正常工作,我可以通过网络浏览器登录到我的 Gitlab 帐户。
通过删除 ~/.ssh/ 中的 any/all Known_hosts 文件然后在终端中执行 ssh git@gitlab.com
并回答 "yes"(重新添加 git@gitlab.com 到 known_hosts 重新创建一个新的 known_hosts 文件后)。
我在 known_hosts 中做了一些乱七八糟的事情,这可能导致了问题。
我在 git 中为 Windows 重新创建了 ssh 密钥并且成功了!
我发现我的家庭资料在 git bash 中加载为 "P:\"(因为我工作的 IT 团队...)。
确保在 git bash 中您已经使用 ssh-keygen
生成了一个 ssh 密钥并且 GitLab 知道该密钥。
如果问题仍然存在,运行 ssh -o StrictHostKeyChecking=no <gitlab-host> uptime
让 gitlab 可信。
在 Windows 中,我在 MS Visual Studio 代码上从 Git 收到此错误。
我必须从 Git Bash 启动它以引入我的 git 和 ssh 环境配置。
<your git bash prompt> $ Code
VS Code 应该会启动,然后您应该可以通过 ssh 克隆一个 repo。