0

I am trying to host a git repository. Googling around found this tutorial regarding hosting git repositories. But things didn’t go well :(

I am using Ubuntu 10.04. IP: 192.168.0.131 Openssh running on port 22

It was going good till setting up gitosis-admin repo. Here is what I did.

I generated public key on this host linux machine and initialzed gitosis with that key.

ssh-keygen –t rsa.
sudo -H -u gituser gitosis-init < ~/.ssh/id_rsa.pub

Then I tried to clone gitosis-admin repository on linux machine with different forms

git clone gituser@192.168.0.131:gitosis-admin.git 

git clone ssh://gituser@192.168.0.131:22/gitosis-admin.git

But getting ERROR:

Permission denied (publickey)
fatal: The remote end hung up unexpectedly

Could you please help me on this?

Vaman Kulkarni
  • 3,411
  • 2
  • 21
  • 22
  • http://stackoverflow.com/questions/1005947/password-problem-with-git-clone-gitosishostgitosis-admin-git could help here – VonC Aug 11 '10 at 12:03
  • Note to moderator: git has nothing to do with superuser. It is a "software tools commonly used by programmers", which is 100% compliant with the StackOverflow FAQ. – VonC Aug 11 '10 at 12:05
  • Is your ssh key installed on the machine you are trying to clone from? – ebneter Aug 11 '10 at 19:25

1 Answers1

1

The problem is not Gitosis itself, but that your SSH key gets rejected. This can be because it has not been authorized (is not in gituser’s authorized_keys file), because your SSH server is configured not to accept public keys, because your SSH key is weak or because you are not sending one at all.

Have a look at the logs of your SSH server to see whether (and why) your public key is rejected. On Ubuntu, the file should be located at /var/log/auth.log. Look for the word publickey and/or try cloning your repository to see what happens in the log file. You can use something like sudo tail -f /var/log/auth.log to watch new entries as they arrive.

scy
  • 7,132
  • 2
  • 27
  • 35
  • Thanks for your reply. Now I am getting error fatal: 'gitosis-admin.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly Google indicates that this is a very common problem. tried all the options i could find with no luck :( Could you please direct me to right path? Thanks a bunch. – Vaman Kulkarni Aug 12 '10 at 11:37
  • This message means that at least the SSH part is working now. However, I’m no Gitosis user, therefore I cannot help you with that error. It would probably be best to ask another question about this. – scy Aug 12 '10 at 11:53