Git configuration (2) Windows install Git and configure Centos
1. Create a Git user for the Centos system
Useradd-d / home/git git # create git user passwd git # change password
2. Open the RAS authentication of Centos system
Vim / etc/ssh/sshd_config
Open the following comments and modify them as follows
3. Download the windows version of Git installation software, and select 32-bit or 64-bit according to the operating system.
Https://git-scm.com/download/win
4. Install Git until the next step
5. Generate the ssh key of windows, right-click on the directory, select Git Bash Here, enter the following command on the open command line, and confirm it all the way.
Ssh-keygen-t rsa-C "youremail@example.com"
6. Upload ssh key to Centos system and enter the following command in Git Bash of Windows
Ssh git@192.168.106.129 'cat > > .ssh / authorized_keys'
< ~/.ssh/id_rsa.pub 成功后检查Centos系统/home/git/.ssh/目录下是否生成authorized_keys文件,以及该文件中是否有Windows的id_rsa.pub公钥内容,文件位于C:\Users\xxx.ssh目录下 7、配置sshd服务 vim /etc/ssh/sshd_config 修改一下内容 PermitRootLogin noUsePAM noPasswordAuthentication noRSAAuthentication yesPubkeyAuthentication yes 重启服务 systemctl restart sshd.service 8、在Centos系统创建版本库 su gitcd /home/git/mkdir repositorycd repositorymkdir test.gitgit init --bare test.git 9、禁止git用户登陆shell,后续创建版本库可由root用户创建,创建完chown为git用户 vim /etc/passwd
10. Through the Windows remote clone version library, create a directory to clone in Windows, open Git Bash, and type
Git initgit clone git@192.168.106.129:/home/git/repository/test.git