GitLab无法在没有公共密钥的情况下克隆公共仓库 [英] GitLab cannot clone public repo without public key

查看:265
本文介绍了GitLab无法在没有公共密钥的情况下克隆公共仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用GitLab 6.8.2.我可以将公共存储库克隆为匿名存储吗?

Using GitLab 6.8.2. Can I clone public repository as anonymous?

我在用户命名空间中有一个标记为public的存储库. 没有公钥保存在GitLab中,我无法克隆它.

I have repo in my user namespace marked as public. I cannot clone it without public key saved in GitLab.

例如:

> ssh -T git@git.site.com
Welcome to GitLab, Known Username!

从具有存储在GitLab中的公钥的帐户进行操作时.

When doing it from account with stored public key in GitLab.

但是,在没有任何密钥和GitLab帐户的情况下从用户执行相同操作时,我有:

But when doing same thing from user without any keys and GitLab account I have:

> ssh -T git@git.site.com
Permission denied (publickey).

详细测试量:

> ssh -v git@git.site.com
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to git.site.com [...] port 22.
debug1: Connection established.
debug1: identity file /home/ubuntu/.ssh/id_rsa type -1
debug1: identity file /home/ubuntu/.ssh/id_rsa-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_dsa type -1
debug1: identity file /home/ubuntu/.ssh/id_dsa-cert type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa type -1
debug1: identity file /home/ubuntu/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.5
debug1: match: OpenSSH_6.5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA ...
debug1: Host 'git.site.com' is known and matches the ECDSA host key.
debug1: Found key in /home/ubuntu/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ubuntu/.ssh/id_rsa
debug1: Trying private key: /home/ubuntu/.ssh/id_dsa
debug1: Trying private key: /home/ubuntu/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).

简单来说,这是SSH不允许使用git@git.site.com建立未经授权的连接.我以为我应该甚至可以匿名访问git@git.site.com和GitLab来手动管理访问.我想这是我的SSH配置错误.

Simply, it's SSH not letting non-authorized connections to be estabilished with git@git.site.com. I thought I should have even anonymous access to git@git.site.com and GitLab to manage access manually. I guess it's my SSH configuration wrong.

如何在没有公共密钥的情况下将公共仓库克隆为匿名?

How can I clone public repo as anonymous without public key?

推荐答案

您可以使用HTTPS而不是SSH来克隆公共存储库,而无需进行任何身份验证.
例如:
这是一个公共存储库: https://gitlab.com/0X1A/dotfiles
该页面还具有使用HTTPS克隆存储库的链接,如下所示:

You can use HTTPS instead of SSH to clone a public repository without any authentication.
For example:
Here's a public repository: https://gitlab.com/0X1A/dotfiles
The page also has link to clone repository using HTTPS, which is as follows:

git clone https://gitlab.com/0X1A/dotfiles.git

git clone https://gitlab.com/0X1A/dotfiles.git

不会要求您进行身份验证.

You will not be asked for authentication.

这篇关于GitLab无法在没有公共密钥的情况下克隆公共仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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