Nomeqc
12/10/2018 - 9:23 AM

Git SSH 添加公钥.md

1.生成公钥

ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -f ~/.ssh/github_id_rsa

2.配置

config文件添加配置(没有config文件则新建):

# github
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github_id_rsa

3.添加公钥

复制~/.ssh/github_id_rsa.pub内容在github上添加公钥

3.测试公钥

ssh -T git@github.com