1. Install linux and git (192.168.1.239)
2. Create a user zph (let this user provide git on server), and set the password to 12345678
# useradd zph <pre name="code" class="html"># passwd zph
3.切换到zph用户
# su zph
$ cd
$ git init --bare sample.git
$ git clone zph@192.168.1.239:/home/zph/sample.git
The terminal will ask you to enter the password. At this time, enter the password of the zph user (12345678)
6. In order to allow users to not have to enter the password every time, in linux Generate the .ssh directory
$ ssh-keygen -t rsa -C "youremail@example.com"
$ cd /home/zph/.ssh/
$ vi authorized_keys
$chmod 600 authorized_keys
$ ssh zph@192.168.1.239
11. Repeat step 5, you no longer need to enter a password
12. If you don’t want zph to log in to the system as an account, you can open /etc/passwdzph:x:1002:1002::/home/zph:/bin/bash改为zph:x:1002:1002::/home/zph:/sbin/nologin
Additional:
The above has introduced an in-depth analysis of git on serverssh. Github provides service principles, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.