Git/SSH Authentifizierung

aus www.kruedewagen.de, Homepage von Ralf und Judith Krüdewagen (Kruedewagen)
< Git
Zur Navigation springen Zur Suche springen

Git repository servers behave different in terms of SSH authentication. This depends on the way SSH is implemented, e.g. by using the standard OpenSSH client/server, an own SSH implementation or a wrapper around it.

A) Gerrit

Gerrit has its own Git-only SSH server. You login with your individual Gerrit username on a separate port (e.g. 29418) and you need a SSH public key registered in your profile (at least for pushes). I guess that read operations also work without SSH key. However, the SSH username is different for each user.

B) GitLab

GitLab (which is my preferred Git repo server) implements a gitlab-shell, which is a wrapper for SSH. All users typically login via ssh://git@server/group/project on standard SSH port 22. So, all users use one and the same git user within the SSH path. Before you can login, you need to add a SSH public key (or more) into your GitLab profile. The GitLab backend now checks the "incoming" SSH key towards all registered public keys and will automatically link your session to your profile. Note: Therefore, one and the same public SSH key can only be assigned to one profile.

C) Gitolite

I guess that Gitolite works similar to GitLab by using only one SSH user name and different SSH keys to authenticate and to link to your profile. See how gitolite uses ssh.