构建Git服务器 [英] Build Git server
问题描述
我正在centos上构建自己的git服务器,我已经完成了所有这些步骤:
I'm building my own git server on centos, I have done all these steps:
我添加了一个名为git的新用户,它的主目录是/home/git
I add a new user named git and it's home is /home/git
然后我使用ssh-keygen -t rsa生成.ssh
and then I use ssh-keygen -t rsa to generate the .ssh
然后我编辑/etc/ssh/sshd_config文件以打开pub_key授权:
then I edit the /etc/ssh/sshd_config file to open the pub_key authorization :
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
然后我在/srv/remote.git中git init --base
then I git init --base in /srv/remote.git
最后,我在客户端上生成了id_rsa.pub并将其复制到我的git服务器:/home/git/.ssh/authorized_keys
finally I generate the id_rsa.pub on my client and copy it to my git server: /home/git/.ssh/authorized_keys
但是当我git克隆存储库时:git @ ip:/srv/remote.git
but when I git clone the repository : git@ip:/srv/remote.git
它总是要求我输入密码,为什么?
it always asks me to enter password, so why?
推荐答案
为了调试正在发生的事情:
In order to debug what is going on:
-
检查客户端上的ssh会话:
check the ssh sesion on the client:
ssh -Tv git@ip
检查服务器上的日志(/var/log/auth.log
)
这篇关于构建Git服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!