Git无法连接Gitlab,SSH验证错误 [英] Git can't connect to Gitlab, SSH verification error

查看:108
本文介绍了Git无法连接Gitlab,SSH验证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 SSH 密钥从 Gitlab 中提取存储库.所有这些都通过 Ubuntu VM 在 Windows 8 的命令行中完成.我已将我的公钥添加到我的 Gitlab 帐户,然后将我的私钥添加到 ssh-agent,这样做似乎没有任何错误,但是当我尝试执行 git pull 或 push 时,我遇到了这个问题错误;

I've been trying to pull down a repository from Gitlab using SSH keys. All done in command line on Windows 8 via a Ubuntu VM. I've added my public key to my Gitlab account and then added my private key to the ssh-agent and didn't seem to have any errors in doing so but when I try and do a git pull or push I run in to this error;

fatal: unable to access 'https://git.mgmt.local/XXX/project-name.git/': 
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

这让我直接撞到了一堵墙......不知道出了什么问题,有人能指出我正确的方向吗?

And that's run me straight in to a wall ... no idea on what's wrong, can anyone point me in the right direction?

推荐答案

那是因为您使用的是 https 网址.

That is because you are using an https url.

Https 意味着存储在 %HOME%.ssh 中的公共和私人 ssh 密钥被使用.完全没有.

Https means the public and private ssh keys stored in %HOME%.ssh are not used. At all.

尝试切换到 ssh 网址:

Try switching to an ssh url:

git remote set-url origin (user)@(ip address):(group)/(project).git

使用标准的 GitLab 安装 (user) 应该是 git.

With a standard GitLab installation (user) should be git.

您可以先检查 ssh 是否正在使用:

You can check first if ssh is working with:

ssh -Tvvv git@your_server.com

这篇关于Git无法连接Gitlab,SSH验证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆