2

I have tried google it and check the gitlab-documentation but did not find a good answer for this.

When I setup GitLab I am advised to test my SSH-keys to my GitLab URL instance. I use git@gitlab.com.

What actually happens when I run "ssh git@gitlab.com" I understand how you use SSH to login to a remote device e.g. Cisco Router with SSH Admin. But in this case: who is git@gitlab.com? [username]@gitlab.com makes more sense to me.

Somehow it must find my Gitlab account (since it is there my public key is stored). How can I do that when I use a generic git@gitlab.com ?

I am after a more step-by-step answer (Client-Server)

Aard
  • 39
  • 1
  • 6

2 Answers2

2

[username]@gitlab.com makes more sense to me

It would not: that would ask to open an SSH session as 'username': that account does not exist. Only one account exists: 'git'.

Then, in ~/.ssh/authrorized_keys, your public key is found, alongside:

  • an ID (as shown here), matching your registered GitLab account,
  • a forced command, which will call a GitLab script in order to execute the Git command.

That way:

  • there is no interractive session possible on GitLab's server
  • the project gitlab-shell gets your ID and hangle your Git query
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks for answer but it generates a new question: doesnt everyone use ’git’ to test their ssh.pub-key? I think I am missing some fundemental knowledge regarding GitLab. So when you open the ssh-session with username ’git’ the gitlab-server recognize the user by the id from autherized_keys? How could the server otherwise know who wants to open the session? – Aard May 01 '21 at 19:59
  • @Aard Yes, the ID matches your GitLab account, that way, the GitLab script called by SSH will know who is requesting a Git operation. No need to use anything but 'git' to test your connection. – VonC May 01 '21 at 20:05
0

for found it, go in repository on clone, select ssh, begin start copy up to :, now test

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 30 '22 at 08:45