Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Git configuration (2) Windows install Git and configure Centos

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report