linux/windows下配置SSH连接GitHub、GitHub配置ssh key。
检查本机是否有ssh key设置(windows打开git bash)
cd ~/.ssh 或cd .ssh
如果没有则提示: No such file or directory
如果有则进入~/.ssh路径下(ls查看当前路径文件,rm * 删除所有文件)
cd ~
保证当前路径在”~”下
ssh-keygen -t rsa -C "xxxxxx@yy.com"
建议填写自己真实有效的邮箱地址
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxxx_000/.ssh/id_rsa): #不填直接回车
Enter passphrase (empty for no passphrase): #输入密码(可以为空)
Enter same passphrase again: #再次确认密码(可以为空)
Your identification has been saved in /c/Users/xxxx_000/.ssh/id_rsa. #生成的密钥
Your public key has been saved in /c/Users/xxxx_000/.ssh/id_rsa.pub. #生成的公钥
The key fingerprint is:
e3:51:33:xx:xx:xx:xx:xxx:61:28:83:e2:81 xxxxxx@yy.com
本机已完成 ssh key 设置
windows 存放路径为:c:/Users/xxxx_000/.ssh/下
linux 存放路径为:~/.ssh/
可生成 ssh key 自定义名称的密钥,默认id_rsa。
linux 查看公钥
cat ~/.ssh/id_rsa.pub