即使ssh有效,Gitlab也无法克隆存储库 [英] Gitlab can't clone repository even though ssh works

查看:101
本文介绍了即使ssh有效,Gitlab也无法克隆存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所述,即使ssh似乎可以工作,我也无法从Gitlab 6服务器克隆存储库.

As the title states, I can't clone a repository from a Gitlab 6 server even though the ssh seems to work.

尝试克隆时,它看起来像这样:

When trying to clone, it looks like this:

git clone ssh://git@domain.de:1337/project/repository.git
Cloning into 'repository'...
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

在项目中,我扮演开发人员"的角色,该人应该有权克隆存储库?

In the project, I have the role of "developer" which should have the rights to clone a repository?

我还检查了我的SSH公钥是否有效

I also checked if my SSH public key is working

ssh git@domain.de -p 1337 -T
Welcome to GitLab, Anonymous!

更让我烦恼的是,对于我的一个朋友来说,一切似乎都很好.

More irritating to me is that for a friend of mine seems everything to work fine.

修改: 此处所述问题的主要指示器是来自SSH测试的问候.在工作环境中,应该用您的名字代替您的名字来问候您!

The main indicator for the problem stated here is the greeting from the SSH Test. In an working enviroment it should be greeting you with your name instead Anonymous!

推荐答案

尝试类似scp的语法:

Try the scp-like syntax:

git clone ssh://git@domain.de:1337:project/repository.git

这实际上迫使使用~/.ssh/config ,这意味着url可以简化为gitlab:project/repositoriy.git.

但是事实证明这是gitlab服务器~gitlab/.ssh/authorized_keys中的ssh关键问题(有点像问题4730 ).
OP Gelix 确认

But it turned out to be an ssh key issue in the gitlab server ~gitlab/.ssh/authorized_keys (a bit like in issue 4730).
The OP Gelix confirms in the comments:

我从authorized_keys中手动从Gitlab中删除了密钥,并在Gitlab上重新读取了它.现在一切都很好.
SSH测试消息现在也为Welcome to GitLab, Felix *****

I removed my key from Gitlab, manually from authorized_keys, readded it on Gitlab. Everything fine now.
Message with SSH Test is now also Welcome to GitLab, Felix *****!

(而不是Welcome to GitLab, Anonymous!)

这篇关于即使ssh有效,Gitlab也无法克隆存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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