7

I'm setting up gitolite for first time. I'm following this instructions.

When I ssh, it looks fine:

$ ssh -p 2222 gitolite@debian
PTY allocation request failed on channel 0
hello gitolite, this is gitolite@debian running gitolite3 v3.5.3.1-1-gf8776f5 on git 1.7.2.5

 R W    gitolite-admin
 R W    testing
Connection to debian closed.

But when trying to clone, it gives me the following error:

$ git clone ssh://gitolite@debian:2222/home/gitolite/repositories/gitolite-admin.git
Cloning into 'gitolite-admin'...
FATAL: R any home/gitolite/repositories/gitolite-admin gitolite DENIED by fallthru
(or you mis-spelled the reponame)
fatal: The remote end hung up unexpectedly

I'm trying to clone from yasin@vonneumann account. I uploaded this user RSA public key to debian server, renamed it to gitolite.pub and ran gitolite setup -pk gitolite.pub with no messages or errors. Then at yasin@vonneumann host I created a file at ~/.ssh/config with the following content:

host debian
     user gitolite
     hostname debian
     identityfile ~/.ssh/gitolite

(I also copied id_rsa as gitolite at vonneumann)

I found this question to be similar, but the answers did not work for me.

Any help appreciated, thanks.

Community
  • 1
  • 1
m0skit0
  • 25,268
  • 11
  • 79
  • 127
  • 3
    About the close vote: *Questions about general computing hardware and software are off-topic for Stack Overflow **unless they directly involve tools used primarily for programming***. There are a bunch of other git/gitolite questions here. – m0skit0 Nov 14 '13 at 11:19
  • Just for a record (as I got the same error, but for a different reason): make sure you actually **did not** put full key file name in gitolite's config file, as you need to strip the `.pub` extension. (This extension is added automatically by gitolite). So, for `keydir/id_rsa-yasin.pub` as authorized key, you need to use `id_rsa-yasin` in `config/gitolite.conf` when referring to it. – Cromax Aug 01 '16 at 12:17
  • @Cromax Correct, but then you won't get the permissions shown on first command. – m0skit0 Aug 01 '16 at 12:21
  • Well, I did — because of this "test" repo that comes with default config (SSH connection parameters, users, identity file were actually set correctly). So at first sight it appeared, that I have no R permissions to other configured repos and that surprised me. (I thought I didn't push config in the first place... but I did)... Then I noticed this *.pub damn thing. ;-) – Cromax Aug 01 '16 at 12:40

1 Answers1

5

If you have a ~/.ssh/config file, you need to use the scp-like syntax for your ssh url:

git clone debian:gitolite-admin.git

With a config like:

host debian
  user gitolite
  hostname debian
  identityfile ~/.ssh/gitolite
  port 2222

And you are not supposed to specify the full path of the repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks, works like a charm; my SSH knowledge is very basic. Btw it's without ssh://, with this prefix it will not work: `ssh: Could not resolve hostname : Name or service not known`. – m0skit0 Nov 14 '13 at 11:36
  • 1
    @m0skit0 right, I have edited the answer to remove the `ssh://`, and add a link to another example of scp-like syntax. – VonC Nov 14 '13 at 12:22