1、The remote server has built up the warehouse.
2.The local clone needs to enter the password and enter the password pull push OK.
3.The local keygen is placed in /c/Users/hh/.ssh.
4.WINSCP Copy id_rsa.pub to server
5.The server is in Su GIT.
Building.Ssh under /home/git
6.Then cat id_rsa.pub > authorized_keys
7.chmod 700 .ssh
chmod 600 .ssh/authorized_keys
Server SSH configuration file
Restart sshd service for above
AuthorizedKeysFile .ssh/authorized_keys It is not possible to restart /home/git/.ssh/authorized_keys service here.
But the remote connection still needs to enter the password.
Excuse me, God, that’s a mistake. Thank you.
File owner error, modification is fine.
Just add the local public key (id_rsa.pub) to the SSH keys in GIT.
You try to delete the local HTTPS repository address.
git remote rm origin
Add another SSH repository address.
git remote add origin
Then write the following contents.
Host git.host.server User git IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes
The first line is the remote warehouse server address, the second line is stationary, the third line represents the private key file address, and the fourth line is stationary.
This will do.