I asked myself how these git hosting tools / sites know which user is logged in.
I mean, you log in via SSH git@github.com /... and that means you log in as a git user
and the only information that reliably identifies you as your real user is your public key. But how do they know your login key?
One way to do this is to look at the log file specified in this question:
Can I find out which ssh key was used to access my account? https://unix.stackexchange.com/questions/15575/can-i-find-out-which-ssh-key-was-used-to-access-an-account
but that means you have to install loglevel in VERBOSE, but I have a Gitlab installation, and loglevel is in INFO and not being overwritten in sshd_config anywhere.
so briefly: if you go to Github or gitlab via SSH it tells you:
ssh git @ github.com Failed to distribute PTY distribution on channel 0
Hi USERNAME! You have successfully authenticated, but GitHub does not provide shell access.
Connection to github.com is closed.
but how does github know that I am USERNAME when I log in as git?
EDIT:
I know that there is a comparison between my key and my account, but the gitolite (or (for example) the gitolit shell must somehow find out my public key, how is this key delivered to the gitolit shell of the legs?
Somehow I need to find out the ssh-public-key that is used in this session, this is the key to my question, how does it know which ssh-key is used to log into the system