安装GIT服务器在CentOs
环境
Alibaba Cloud Elastic Compute Service CentOS 8.2 64bit
[root@localhost~]# uname -a
Linux localhost 4.18.0-193.14.2.el8_2.x86_64 #1 SMP Sun Jul 26 03:54:29 UTC 2
020 x86_64 x86_64 x86_64 GNU/Linux
安装git及相关依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
yum install git
创建用户git
adduser git #添加用户git
passwd git #更改git的密码
为安全考虑需要禁止该用户shell登陆
vi /etc/passwd
#找到git的行,将/bin/bash更换为/usr/bin/git-shell
#git:x:1000:1000::/home/git:/bin/bash
git:x:1000:1000::/home/git:/usr/bin/git-shell
#查找git-shell目录
[root@localhost bin]# find / -name git-shell
/usr/bin/git-shell
/usr/libexec/git-core/git-shell