【git】SSH管理

ssh-keygen -t rsa -C "[email protected]" -f ~/.ssh/id_rsa

注:id_rsa 可以任意命名

配置config ,位置~/.ssh/config

# gitee
Host gitee.com  
	Preferredauthentications publickey
	HostName gitee.com
	IdentityFile ~/.ssh/id_ed25519
 
# 公司(个人)
Host company.com
	Preferredauthentications publickey
    # 配置内网地址
	HostName 192.168.x.xx
	IdentityFile ~/.ssh/id_rsa


$ ssh -T [email protected]  (又如:ssh -T [email protected])
Enter passphrase for key '/c/Users/hp/.ssh/id_rsa':
Hi XX! You've successfully authenticated, but GitHub does not provide shell access.

git init
git add .
git commit -m "init"
git remote add origin "[email protected]:XX/recommend.git"
git push -u origin master

生成/添加SSH公钥 - Gitee.com

你可能感兴趣的:(git,ssh,github)