没有公钥,GitLab 无法克隆公共存储库

2024-04-21

使用亚搏体育appGitLab 6.8.2。我可以以匿名方式克隆公共存储库吗?

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

例如:

> ssh -T [email protected] /cdn-cgi/l/email-protection
Welcome to GitLab, Known Username!

当使用 GitLab 中存储的公钥的帐户执行此操作时。

但是,当没有任何密钥和 GitLab 帐户的用户做同样的事情时,我有:

> ssh -T [email protected] /cdn-cgi/l/email-protection
Permission denied (publickey).

详细输出:

> ssh -v [email protected] /cdn-cgi/l/email-protection
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 不允许建立未经授权的连接[电子邮件受保护] /cdn-cgi/l/email-protection。我想我什至应该可以匿名访问[电子邮件受保护] /cdn-cgi/l/email-protection和 GitLab 手动管理访问。我猜是我的 SSH 配置错误。

如何在没有公钥的情况下以匿名方式克隆公共存储库?


您可以使用HTTPS代替SSH无需任何身份验证即可克隆公共存储库。
例如:
这是一个公共存储库:https://gitlab.com/0X1A/dotfiles https://gitlab.com/0X1A/dotfiles
该页面还包含使用 HTTPS 的克隆存储库的链接,如下所示:

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

系统不会要求您进行身份验证。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

没有公钥,GitLab 无法克隆公共存储库 的相关文章

随机推荐