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.

I've installed gitosis as described here: http://gist.github.com/264304

One of the things that I had to adjust was to give my git user permissions to use ssh (which I did trough server admin -> access -> ssh and added the 'git' user).

When I ssh from my local machine (mac osx) as the git user, I get this response:

PTY allocation request failed on channel 0
bash: gitosis-serve: command not found
                                      Connection to 10.0.0.108 closed.

Which I think is normal, because in Pro GIT the author says you should get something like this if you try ssh'ing to the server using your git user:

PTY allocation request failed on channel 0
fatal: unrecognized command 'gitosis-serve schacon@quaternion'
  Connection to gitserver closed.

So far so good, I think? Now when I try to clone my gitosis-admin.git repository using this command:

$git clone git@10.0.0.108:gitosis-admin.git

I get this:

Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/
bash: gitosis-serve: command not found
fatal: The remote end hung up unexpectedly

So after doing some searching, I found an answer here on serverfault claiming I should use ssh:// as protocol for my git clone (which I thought is the default git protocol?) However, when I try:

$git clone ssh://git@10.0.0.108:gitosis-admin.git

This is the response:

The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
Password:
Password:
Permission denied (publickey,keyboard-interactive).
fatal: The remote end hung up unexpectedly

When I type in my own password (because my git user has no password), I get following error:

The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
bash: git-upload-pack: command not found
fatal: The remote end hung up unexpectedly

I added my upload-pack location as followed:

$git clone -u /usr/local/git/bin/git-upload-pack ssh://git@10.0.0.108:gitosis-admin.git

I get the error that gitosis-admin.git isn't a git repo...

Initialized empty Git repository in /Users/joggink/gitosis-admin/.git/
The authenticity of host ' (::1)' can't be established.
RSA key fingerprint is 80:4d:77:c7:78:cb:c9:42:e3:82:06:7c:fe:c0:08:ce.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (RSA) to the list of known hosts.
Password:
fatal: 'git@10.0.0.108:gitosis-admin.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

I've been searching for a solution for almost a week now, and every topic I've found on the internet gives no result...

share|improve this question
add comment

3 Answers 3

up vote 1 down vote accepted

I always had the same problem, and it is a little tricky to find out the reason. I tried exchanged the server name by the IP:

git clone git@frontend1:gitosis-admin.git

by

git clone git@192.168.155.101:gitosis-admin.git

and got the message that the gitosis-serve was not found, i.e., the /usr/local/bin path is not included when calling gitosis-serve with the .ssh/authorized_keys.

Therefore, in the file ~git/.ssh/authorized_keys (as the admin) I exchanged gitosis-serve by /usr/local/bin/gitosis-serve, i.e., the full path name. Afterwards, the command

git clone git@frontend1:gitosis-admin.git

worked fine.

share|improve this answer
    
thanks! Changing the path in the authorized_keys did it. –  user38316 Mar 25 '10 at 17:59
add comment

Try to change git user shell from git-shell to sh
For example:
From
git:x:1000:1000::/home/git:/usr/bin/git-shell
To
git:x:1000:1000::/home/git:/bin/sh

This helped me.

share|improve this answer
add comment

I encountered the same problem when trying to install gitosis on Ubuntu Linux 10.04 (lucid lynx). I uninstalled gitosis, removed the home directory (/srv/gitosis/ for me) and restarted the instructions at the Ubuntu community git page. The problem did not occur again when I got to that step.

share|improve this answer
    
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Scott Pack Nov 19 '12 at 14:13
add comment

Your Answer

 
discard

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