1

I started to work for a new client and they have a GitLab subdomain to keep all their repositories. I applied my ssh key and gpg2 keys to their GitLab account. However, when I try to clone via ssh, I time out. But if I were to clone via HTTPS, everything works fine.

What step am I missing to get the ssh portion working?

Cloning via https does work.

https://gitlab.company_sub_domain.com/company/repository.git

Cloning via ssh does not work.

git@gitlab.company_sub_domain.com:company/repository.git

config file:

enter image description here

In case this may be of any help:

enter image description here

Mix Master Mike
  • 1,079
  • 17
  • 26

1 Answers1

0

Try completing your ssh config file with

Host companysub
  Hostname gitlab.company_sub_domain.com
  User git
  IdentityFile ~/.ssh/id_ed25519

(put the "Preferredauthentication publickey" part in Host *)

That way, your URL would become companysub, as in:

git clone companysub:company/repository.git

First, try an ssh -Tv companysub, to check if the key is recognized and working.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I went ahead and updated my `Host *` with `PreferredAuthentication publickey` as well as the other steps you had laid out but nothing seemed to work unfortunately. I also checked to see if this was a firewall issue at the office but had the same experience at home. In the interim I've gone ahead and connected to the repo via HTTPS. I'll continue to try and figure out a SSH solution during my down time. If I can figure out a solution I'll be sure to update this question. – Mix Master Mike Dec 26 '18 at 18:37
  • @MixMasterMike Try with a classic rsa key, instead of an ed25519 one. Make sure to use a PEM one, not an openssh one: see https://stackoverflow.com/a/53729009/6309 – VonC Dec 26 '18 at 20:38