开发者

problem with cloning git repository

开发者 https://www.devze.com 2023-01-11 06:22 出处:网络
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 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 git开发者_Python百科osis 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消