简体   繁体   English

克隆git存储库的问题

[英]problem with cloning git repository

I am trying to host a git repository. 我正在尝试托管git存储库。 Googling around found this tutorial regarding hosting git repositories. 谷歌搜索发现有关托管git存储库的本教程 But things didn't go well :( 但是事情进展不顺利:(

I am using Ubuntu 10.04. 我正在使用Ubuntu 10.04。 IP: 192.168.0.131 Openssh running on port 22 IP:192.168.0.131 Openssh在端口22上运行

It was going good till setting up gitosis-admin repo. 直到设置gitosis-admin回购,一切都很好。 Here is what I did. 这是我所做的。

I generated public key on this host linux machine and initialzed gitosis with that key. 我在这台主机linux机器上生成了公共密钥,并使用该密钥初始化了gitosis。

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 然后我尝试以不同形式在Linux机器上克隆gitosis-admin存储库

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. 问题不在于Gitosis本身,而是您的SSH密钥被拒绝。 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. 这可能是因为未经授权(不在gituserauthorized_keys文件中),由于您的SSH服务器配置为不接受公共密钥,由于您的SSH密钥较弱或根本没有发送一个公共密钥,因此可能是由于未对其进行授权。

Have a look at the logs of your SSH server to see whether (and why) your public key is rejected. 查看您的SSH服务器的日志,以查看是否(以及为什么)您的公钥被拒绝。 On Ubuntu, the file should be located at /var/log/auth.log . 在Ubuntu上,该文件应位于/var/log/auth.log Look for the word publickey and/or try cloning your repository to see what happens in the log file. 查找单词publickey和/或尝试克隆存储库以查看日志文件中发生的情况。 You can use something like sudo tail -f /var/log/auth.log to watch new entries as they arrive. 您可以使用sudo tail -f /var/log/auth.log类的东西来监视新条目的到达。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM