ssh-keygen -t rsa -C "xxx@xx.com" -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 git@github.com (又如:ssh -T git@company.com)
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 "git@github.com:XX/recommend.git"
git push -u origin master