'What happens when I run "ssh [email protected]

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 [email protected].

What actually happens when I run "ssh [email protected]" 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 [email protected]? [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 [email protected] ?

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



Solution 1:[1]

[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

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VonC
Solution 2 Yuri Furtado Alcantara