Set up Gitosis but can't clone

I installed Gitosis in a remote Ubuntu field, which I will call linuxserver as my host in the following commands. I also connect from a Windows window using Cygwin.

I followed the instructions as per: http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

I had no problems until I needed to clone the gitosis-admin repository to my local machine

git clone git@linuxserver :gitosis-admin.git 

When I do this, the command is executed, but it hangs there, not displaying anything, until I return to the ctrl-c command line. Messages are not displayed at all.

I am sure that I have installed my ssh keys correctly, because logging in using "ssh linuxserver" in my regular account works fine without asking for a password.

Edit: On the weekend, I installed an almost identical Ubuntu box at home and had no problems setting up Gitosis. The only difference was that I was connecting from OSX instead of Cygwin.

Edit: I also found that when using the Bash shell provided with "Git Extensions" I have no problems, so the problem definitely seems to be a kind of Cygwin conflict.

Edit: Just an update, but a month after posting this question, I switched to Mercurial and found that I prefer it a lot more than git. Thanks for the suggestions, but I do not plan to return to git to try any of them.

+4
source share
6 answers

I also recommend setting the debug option to conf.

 [gitosis] loglevel = DEBUG 
+3
source

Have you checked /var/log/messages on your server?
Maybe the git username is not working properly: from the Gitosis comments ,

if you look at the authorized_key file, you will see that it did not import the name of the system on which the key was generated, but the name of the server field.

Example: using the username "git" led to this in an authorized key

 root@git-repo :/home/git/.ssh# cat authorized_keys command="gitosis-serve root@git-repo " 

After going to username "gitosis" it looks like

 root@git-repo :/home/gitosis/.ssh# cat authorized_keys command="gitosis-serve myuser@mylocalbox ", 

To fix, I created a gitosis user with home dir / home / gitosis and ran the git -init script again.

 sudo -H -u gitosis gitosis-init < /tmp/id_rsa.pub sudo chmod 755 /home/gitosis/repositories/gitosis-admin.git/hooks/post-update 

then on the local field.

 git clone gitosis@YOUR _SERVER_HOSTNAME:gitosis-admin.git 
+1
source

I found these instructions, provided more explanation for what you do when you install gitos. May help someone.

+1
source

I had the same problem as you and my solution to the problem was to add the user β€œgit” to the allowed users in the ssh configuration file on the server. The main oversight is yes - but since I followed the same tutorial and this step is not mentioned, it can easily be that other people forgot to add the git user to the ssh configuration file.

+1
source

I had a similar problem on my computer. I installed gitosis on Archlinux and it works on startup

 git clone ssh:// git@localhost /oslab.git 

But if I change localhost to IP, for example 192.168.1.1, it freezes.

+1
source

If someone else had this problem and tried to connect from the Cygwin environment on a client who also installed Msys Git, check the value of the GIT_SSH environment variable. It must be uninstalled or equal to / usr / bin / ssh, not plink.exe

I managed ssh on the server as a Git user (with the expected abandonment of gitosis scripts), however I could not clone.

I realized that something strange happened because Git was still warning that the host was unknown and there was no direct ssh connection. This was confirmed when I looked at the output of strace

 strace git clone git@server :gitosis-admin.git | less 

A search for sting "ssh" showed that GIT_SSH pointed to plink.exe, the ssh hairpin client used by Msys Git. I do not know why plink.exe does not work, but installed GIT_SSH = / usr / bin / ssh fixed.

0
source

All Articles