sshkey访问github
作者:互联网
1.生成git的对称密钥对
ssh-keygen -t rsa -C "xxx@gamil.com"
~/.ssh 下生成的文件为:
github
github.pub
2.配置密钥
将github.pub公钥配置到github
https://github.com/settings/keys
3.配置本地私钥路径
>> cd ~/.ssh
新建config文件
```
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github
如果配置了gitee,则添加:
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee
```
4:检查配置是否成功
ssh -T git@github.com
可能要输入生成密钥对时设置的密码
Enter passphrase for key '~/.ssh/github':
标签:github,sshkey,配置,gitee,访问,ssh,com,密钥 来源: https://www.cnblogs.com/JimmyBright/p/16197063.html