Robert Palmer <robert.pal...@ingenutec.com> writes:

> I'm using the community edition.
>
> I'm wanting to understand the URI used for pushing with ssh.  It shows 'git 
> @ gitlab.com:...' this implies that the username being used is 'git', 
> correct?
>
> When I pushed, it DID ask me for my ssh password.  How does gitlab know 
> that it's ME since the username is 'git' not my username?  Obviously, 
> somehow it figures it out because my ssh password worked.

If you have access to the machine running gitlab it's rather easy to
figure this out.

Logging into your gitlab server have a look at `/etc/passwd`. There
you'll find where the user `git` has its `$HOME`. Go there and take a
look at the ssh authorized keys file (`.ssh/authorized_kesy`). In it
you'll find entries of the form

    command="/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell 
key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty 
ecdsa-sha2-nistp256 <key> <user>

The `command=...` bit is the ssh magic. If you read the section
"Authorzied_keys file format" in the manpage for sshd you'll find all
the details of what it means. The short version is that it names a
command to run when that key is used (instead of your login shell).

To understand exactly how `gitlab-shell` works you'll have to dig into
its source. I had a quick look in the source, but didn't find it. I'm
sure someone with better knowledge of the gitlab source can point you in
the right direction.

Hope this helped you on your way.

/M

-- 
Magnus Therning,  magnus.thern...@cipherstone.com
Cipherstone Technologies AB
Theres Svenssons gata 10, 417 55 Gothenburg, Sweden

You do not examine legislation in the light of the benefits it will
convey if properly administered, but in the light of the wrongs it
would do and the harms it would cause if improperly administered.
     -- Lyndon Johnson

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/87eg9a9y33.fsf%40sobel.cipherstone.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to