git服务器
一、ssh协议
密码认证访问
-服务器安装git
-使用git命令初始化版本仓库
-客户端使用ssh远程访问
[root@web ~]# git init --bare /var/lib/git/ssh
[root@web ~]# vim /etc/gitweb.conf//设置仓库根目录
第10行的位置添加
…
$projectroot = “/var/lib/git”;
…
[root@client ~]# git clone root@192.168.4.15:/var/lib/git/ssh
二、免密远程Git服务器(秘钥授权)
-客户端生成ssh秘钥
-将秘钥拷贝给Git服务器
-测试上传,上传代码到远程服务器
[root@client ~]# ssh-keygen -f /root/.ssh/id_rsa -N ‘’
[root@client ~]# ssh-copy-id 192.168.4.15
[root@client ~]# git push