1

So I got gitolite set up. Simple. But there is one issue I am having. The SSH urls follow the format of git@host:repo. I'm used to Bitbucket / Github where the urls follow the format of git@host:user/repo. Is there a way to get the latter format using gitolite?

Another question. I have my ~/.ssh/config file set up with the following entry:

Host <host>
User <user>
IdentityFile <path/to/public/key>

I don't have any configuration specifying git as a user, and yet I am able to clone git@host:repo without problem. Obviously, my ssh client is using my public key to access the server which is why gitolite is letting me clone the repo, but how does my ssh client know to use my public key which is only configured for the <user> user and not the git user?

knpwrs
  • 357
  • 1
  • 4
  • 14

1 Answers1

0

See Gitolite and ssh

Restricting users to specific commands is very important for gitolite.
If you read man sshd and look for authorized_keys file format, you'll see a lot of options you can add to the public key line, which restrict the incoming user in various ways. In particular, note the command= option, which means "regardless of what the incoming user is asking to do, forcibly run this command instead".

Also note that when there are many public keys (i.e., lines) in the authorized_keys file, each line can have a different set of options and command= values.

Without this command= option, the ssh daemon will simply give you a shell, which is not what we want for our gitolite keys (although we may well have other keys which we use to get a shell).

This is the backbone of what makes gitolite work; please make sure you understand this.

Those command= are using the name of your public key as the user name.

So all your ssh queries are done with:

  • the user git
  • a public key whose name is registered in the parameters of the command= directive in the ~git/.ssh/authorized_keys.

As for user/repos, the closest you would have with Gitolite is in wild repos and repo pattern.

repo    CREATOR/a[0-9][0-9]
VonC
  • 2,653
  • 5
  • 29
  • 48