Windows配置Github的SSH-key

检查已存在的SSH key

  1. 打开Git Bash
  2. 输入 cd ~/.ssh/ ls

生成新的SSH key

  1. 打开Git Bash
  2. ssh-keygen -t rsa -b 4096 -C "your_email@.com"example 生成一个新的ssh key,使用填入的邮箱地址作为ssh key的标签,并生成RSA密钥对
  3. 出现如下提示时: Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] 按下回车

Github账号添加SSH key

  1. 前往 GitHub 网站的”account settings”,依次点击”Setting -> SSH Keys”->”New SSH key”
  2. title随填写,key处拷贝 ~/.ssh/id_rsa.pub 中的内容

测试连接

ssh -T git@github.com

1
2
3
$ ssh -T git@github.com
Hi tracypen! You've successfully authenticated, but GitHub does not provide shell access.