Win10 配置 SSH 访问GitHub

Win10 配置 SSH 访问GitHub

Scroll Down

Win10 配置 SSH 访问GitHub

生成SSH

打开git bash

$ 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

来到C:\Users\xxx\.ssh目录下, 复制id_rsa.pub 文件内容到 GitHub 中即可

配置账户

打开git bash

$ git config --global user.name “your_username”  #设置用户名

$ git config --global user.email “your_registered_github_Email”  #设置邮箱地址(建议用注册giuhub的邮箱)

测试

$ ssh -T git@github.com
Hi iscolt! You've successfully authenticated, but GitHub does not provide shell access.
支付宝 微信