ssh - 没有公钥,GitLab 无法克隆公共(public)仓库

标签 ssh gitlab

使用 GitLab 6.8.2。我可以匿名克隆公共(public)存储库吗?

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

例如:

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

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

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

> 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 配置错误。

如何在没有公钥的情况下将公共(public)存储库克隆为匿名?

最佳答案

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

git clone <a href="https://gitlab.com/0X1A/dotfiles.git" rel="noreferrer noopener nofollow">https://gitlab.com/0X1A/dotfiles.git</a>

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

关于ssh - 没有公钥,GitLab 无法克隆公共(public)仓库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22798446/

相关文章:

php - 尝试查找和删除文本以修复WP恶意软件时,SSH命令无法正常工作

bash - 将命令作为输入传递给另一个命令(su、ssh、sh 等)

python - mac 上的 ssh -X 在 matplotlib 中给出错误

linux - 可以在同一台主机上的特定端口上运行命令吗?

ssh - Ansible 无法使用不同用户在本地主机上创建文件夹

GitLab 在出现 50 次后停止为 Markdown 文件呈现文本内 LaTeX

gitlab - 如何从 GitLab api 创建合并请求审查?

gitlab - 如何将gitlab 6连同旧数据一起升级到7?

ruby-on-rails - 乘客 bundler /设置 LoadError

GitLab 手 Action 业 on_failure 和自动 on_success