Cannot clone repository: FATAL: R any gitolite-adm

2019-02-07 12:34发布

问题:

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.

回答1:

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.