Cannot clone repository: FATAL: R any gitolite-admin gitolite DENIED by fallthru - linux

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.

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.

Related

Git clone using ssh does not work with message "git#github.com: No such file or directory"

I'm trying to clone a private Github repo from my linux Mint computer using ssh.
I have created a private/public key pair and registered it with Github (different than the default id_rsa).
When I try ssh -vT git#github.com , I have successful authentication.
But when I make a git clone using the URL given by GitHub, I get the following error :
git clone git#github.com:benblan/{private_repo}.git
Cloning into '{private_repo}'...
git#github.com: No such file or directory
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
The ssh-agent is running.
ps -eaf | grep ssh
benblan 1525 1455 0 09:58 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/im-launch cinnamon-session-cinnamon
benblan 2109 1452 0 09:59 ? 00:00:00 /usr/bin/ssh-agent -D -a /run/user/1000/keyring/.ssh
The only thing I see is that when I echo the variable SSH_AUTH_SOCK, I have a different path : /run/user/1000/keyring/ssh (no dot in front of ssh).
I could use HTTPS with Personal Access Token, but I wanted to make the ssh connection work.
Any idea?
Double-check your ssh client is fully installed/up-to-date:
sudo apt update
sudo apt install openssh-client
And specify the full path for ssh and your key:
export GIT_SSH_COMMAND="/usr/bin/ssh -i ~/.ssh/id_rsa"
Then try again.
The alternative would be to reference the same private key by a ~/.ssh/config file:
Host gh
Hostname github.com
User git
IdentityFile ~/path/to/private_key
And
git clone gh:benblan/{private_repo}.git

Git clone with ssh works in Linux but not in Windows PowerShell

I have a repo at GitHub. When cloning it in Linux using ssh it works fine:
> git clone git#github.com:henrikppersson74/frokenjennnie.git
Cloning into 'frokenjennnie'...
Enter passphrase for key '/home/----/.ssh/id_rsa':
.
.
Reinitialized existing Git repository in /home/*
When doing the same thing in Windows PowerShell it doesn't work:
> git clone git#github.com:henrikppersson74/frokenjennnie.git
Cloning into 'frokenjennnie'...
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have copied my private and public SSH keys from Linux to my Windows machine and they are stored in my ~/.ssh/ as id_rsa and id_rsa.pub.
It seems to work when I try to access github.com with ssh from PowerShell:
> ssh git#github.com
Enter passphrase for key 'C:\Users\-----/\.ssh\id_rsa':
PTY allocation request failed on channel 0
Hi henrikppersson74! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
This is the same answer I get when doing this in Linux. I guess this means the my SSH-key par is ok?
When working in Eclipse in Windows, using the "Git Repositories" view it works fine to clone the same repo.
Previously I created new SSH keys in the PowerShell and copied the public one to GitHub, but with the same result.
My ~/.ssh/config file lookes like this:
Host github.com
HostName github.com
IdentityFile ~\.ssh\id_rsa
User git
ForwardAgent yes
I am using Git version:
> git --version
git version 2.28.0.windows.1
Unfortunately I get no extra information from using the --verbose flag:
> git clone git#github.com:henrikppersson74/frokenjennnie.git --verbose
Cloning into 'frokenjennnie'...
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It doesn't help to add the key to the ssh-agent:
> ssh-add C:\Users\-----\.ssh\id_rsa
Enter passphrase for C:\Users\-----\.ssh\id_rsa:
Identity added: C:\Users\------\.ssh\id_rsa (C:\Users\-----\.ssh\id_rsa)
> git clone git#github.com:henrikppersson74/frokenjennnie.git --verbose
Cloning into 'frokenjennnie'...
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could my old keys be cashed somewhere?
Does anyone have any idea about why I am not able to clone my repo in Windows PowerShell? I would be so grateful for some help.
The problem was that my %HOME% environment variable was set to the wrong location. When I changed it back to C:\Users\<userid> it worked like charm. Apparently SSH first looks for a key in %HOME%\.ssh\, then for en entry in %HOME%\.ssh\config\ and last it uses the keys added to the ssh-agent.

gitolite FATAL: R any gitolite-admin git DENIED by fallthru

.ssh/config
host git-server
user git
hostname 127.0.0.1
identityfile ~/.ssh/git
port 6827
run: git ls-remote git-server:gitolite-admin.git
error: FATAL: R any gitolite-admin git DENIED by fallthru (or you
mis-spelled the reponame) fatal: Could not read from remote
repository.
Please make sure you have the correct access rights
Simply try first ssh git#host info
[That will] tells you what version of gitolite and git are on the server, and what repositories you have access to.
That is better than ssh to the server, which a regular user could not do anyway, because their SSH public key is associated to a gitolite "force command": they cannot get an interactive session.
Note that for accessing the gitolite-admin.git main configuration repository, you need to use the key that you had when doing the gitolite installation

git clone using ssh failed in Windows due to permission issue

I have created a new GIT repository in my server at /home/myuser/.git/project.git.
I found ssh key for git from C:\Users\Toshiba\.ssh\github_rsa.pub & appended with server's authorized_keys file.
when i try to do git clone using ssh it fails as below.
$ git clone ssh://myuser#mysite.net:2888/home/myuser/.git/project.git
Cloning into 'project'...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Could you please help me in resolving this issue.
If your public/private key doesn't have the standard name C:\Users\Toshiba\.ssh\id_rsa(.pub), but C:\Users\Toshiba\.ssh\github_rsa.pub, then you need an ssh config file
Host mysite
Hostname mysite.net
User myuser
Port 2888
IdentityFile C:\Users\Toshiba\.ssh\github_rsa.pub
That would allow you to do
git clone mysite:/home/myuser/.git/project.git
Test it first wih ssh -Tvvv mysite, and then ssh mysite ls.
Make sure the environment variable %HOME% is defined to C:\Users\Toshiba
You have another example in "SSH error on push to an existing project Permission denied (publickey)"

Gitolite Error: gitolite-admin not a repo

Quick Note: Before anyone points it out, I did originally post this on Server Fault, but after doing so I realized this site may be more appropriate. Sorry for the "double post".
I had installed gitolite about 6 months ago and all of a sudden I started getting this error:
fatal: 'gitolite-admin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
I have read a lot of other topics on this and done everything they suggested from removing the auth keys and adding a config file in ~/.ssh. Mine is below:
host myhost
user git
hostname myhost
port 22
identityfile ~/.ssh/id_rsa
host mygit
user git
hostname myhost
port 22
identityfile ~/.ssh/obto
Sadly, though, I'm still getting the fatal error. Does anyone have any ideas?
I solved this issue by doing what you just said: I create a file called config in my client machine:
vim ~/.ssh/config
Host 192.168.0.14
user git
hostname 192.168.0.14
port 22
identityfile ~/.ssh/userX
The userX file is your public file (userX.pub). Then I cloned the gitolite-admin repository in my client machine by doing:
**git clone 192.168.0.14:gitolite-admin**
Cloning into 'gitolite-admin'... Enter passphrase for key
'/home/userX':
Now you should enter the password of your key. And that's it. I hope this helps.
Regards.

Resources