0

I'm having trouble accessing my gitlab repo through SSH.

When trying the connection through below line I get authenticated.

ssh -T git@gitlab.<mydomain>

But when trying to access through the lines below its not prompting for my SSH password.

PS ~> git clone git@gitlab.<mydomain>:<repo name>.git      
Cloning into '<repo name>'...
git@gitlab.<mydomain>'s password:
Permission denied, please try again.

The git remote -v seems to be correct:

origin  git@gitlab.<mydomain>:<repo name>.git (fetch)
origin  git@gitlab.<mydomain>:<repo name>.git (push)

Any more ideas on how to authenticate through SSH?

Patrick Bender
  • 407
  • 4
  • 16

1 Answers1

0

The first uses (Open)SSH's authentication scheme, which includes looking in the ~/.ssh directory for known SSH keys.

The second uses Gitlab's SSH authentication scheme, which requires you to add your public key through the Gitlab interface. It should be somewhere under Account Settings->Security->SSH keys.

rubenvb
  • 74,642
  • 33
  • 187
  • 332
  • Yes, I have done that by coping the key through the terminal. So it should be correct. – Patrick Bender Dec 18 '20 at 14:46
  • But have you added your SSH keys through the Gitlab interface? That's usually accessed through a web browser. I'm not sure if there is any API provided to set SSH keys. I added a link to the Gitlab documentation explaining this step. – rubenvb Dec 18 '20 at 14:47
  • Yes I have added it under user settings -> SSH Keys – Patrick Bender Dec 18 '20 at 16:40