Windows配置Github的SSH-key
检查已存在的SSH key
- 打开Git Bash
- 输入
cd ~/.ssh/
ls
生成新的SSH key
- 打开Git Bash
ssh-keygen -t rsa -b 4096 -C "your_email@.com"
example 生成一个新的ssh key,使用填入的邮箱地址作为ssh key的标签,并生成RSA密钥对- 出现如下提示时:
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
按下回车
Github账号添加SSH key
- 前往 GitHub 网站的”account settings”,依次点击”Setting -> SSH Keys”->”New SSH key”
- title随填写,key处拷贝 ~/.ssh/id_rsa.pub 中的内容
测试连接
ssh -T git@github.com
1 | $ ssh -T git@github.com |