Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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]
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.