Question

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

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

For example:

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

When doing it from account with stored public key in 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).

Detailed otput:

> 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).

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?

Was it helpful?

Solution

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

You will not be asked for authentication.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top