Server, git password-free configuration

Server password-free login:

  1. ssh-keygen generates key pair
  2. Copy id_rsa.pub (public key) to the server ~/.ssh/authorized_keys
  3. (Not required) After id_rsa is renamed (id_rsa_test), config needs to be configured
Host 服务器IP(域名)
	HostName 服务器IP(域名)
	IdentityFile C:\Users\a1109\.ssh\id_rsa_test

git password-free ssh:

  1. ssh-keygen generates key pair
  2. Copy id_rsa.pub (public key) to git deployment key
  3. (Not required) After id_rsa is renamed (id_rsa_git_test), configuration needs to be performed

a. Need to configure config

Host git_test(匹配入口)
	HostName gitee.com
	User git
	IdentityFile ~/.ssh/id_rsa_git_test

b. Modify the remote address

	git config remote.origin.url git_test:gitname/****.git

	   原地址: git@gitee.com:gitname/****.git
	 匹配规则: User@HostName:gitname/****.git

Guess you like

Origin blog.csdn.net/chenxiabinffff/article/details/108217183