https://git-scm.com/download/linux(git官网)
https://mirrors.edge.kernel.org/pub/software/scm/git/(镜像)
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz(镜像地址:下载)
tar -zxf git-2.9.5.tar.gz
cd git-2.9.5
./configure --prefix=/usr/local/git ok
make
yum install -y zlib-devel
yum install perl-ExtUtils-MakeMaker
yum install tcl build-essential tk gettext
make ok
make install ok
添加全局环境变量:vim /etc/profile
重新载入使生效:source /etc/profile
=================================================================================
添加git用户,管理服务
root 创建项目主目录,赋权git所有,git初始化裸仓库
root 创建用户xx,附加组git
win:git:客户端git和xx------------ git-upload-pack:error
git服务端:ln -s /usr/local/git/bin/git-upload-pack /usr/bin/git-upload-pack
测试中:删除~/.ssh/known_hosts 文件
win:客户端:git和xx, git clone ok
test==================
git服务端: ln -s /usr/local/git/bin/git-receive-pack /usr/bin/git-receive-pack
=====================================================================================
登录访问:client-server
yum install openssh*
vim /etc/ssh/sshd_config -> GSSAPIAuthentication no :ok
ssh访问:client(xx)-server
vim /etc/ssh/sshd_config
git 添加 auth文件
xx: 创建密钥
将client: /home/xx/.ssh/id_rsa.pub 内容,添加到server:/home/git/.ssh/authorized_keys (root)
服务器端~.ssh/目录下执行命令:
要保证.ssh和authorized_keys都只有用户自己有写权限。否则验证无效。
chmod 600 authorized_keys
切换到~执行:
chmod 700 -R .ssh