搭建 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 clone 存储库时: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屋!