ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/github_id_rsa
在config
文件添加配置(没有config文件则新建):
# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa
复制~/.ssh/github_id_rsa.pub
内容在github
上添加公钥
ssh -T git@github.com