问题描述
正如标题所述,即使 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://[email protected]: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 [email protected] -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://[email protected]: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:
我从 Gitlab 中手动从 authorized_keys
中删除了我的密钥,并在 Gitlab 上读取了它.现在一切都很好.
带有 SSH 测试的消息现在也是 Welcome to GitLab, Felix *****
!
(而不是 欢迎来到 GitLab,匿名!
)
这篇关于即使 ssh 工作,Gitlab 也无法克隆存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!