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

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

问题描述

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

 致命:无法访问'https://git.mgmt.local/XXX/project-name.git/ ':
服务器证书验证失败。 CAfile:/etc/ssl/certs/ca-certificates.crt CRLfile:none

这就是我运行的直接进入墙壁...不知道有什么不对,任何人都可以指向正确的方向吗? 因为您使用的是https url。



Https表示储存在%HOME .ssh中的公钥和私钥ssh不是使用的。



尝试切换到ssh url:

  git远程设置网址来源(用户)@(IP地址):(组)/(项目).git 

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



您可以先检查ssh是否正在处理:

  ssh -Tvvv git@your_server.com 


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?

解决方案

That is because you are using an https url.

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

Try switching to an ssh url:

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

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

You can check first if ssh is working with:

ssh -Tvvv git@your_server.com

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

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