1、首先安装git,百度云盘下载的地址:http://pan.baidu.com/s/1jHZb838)

2、安装好以后打开:Git Bash, 执行:

// 这里的Marishunxiang@gmail.com 是我的Github的帐号,换成你的自己帐号就好了

$ ssh-keygen -t rsa -C "Marishunxiang@gmail.com"
  •  

3、然后进入当前的用户的目录下,打开 .ssh 文件夹里面会有2个文件: id_ras 和 id_rsa.pub,比如我的电脑是Windows 8.1 系统目录是:

C:\Users\Administrator\.ssh
  •  

这里写图片描述

4、登录GitHub系统;点击右上角账号头像的“▼”→Settings→SSH and GPG keys →New SSH key。

5、复制id_rsa.pub的公钥内容。添加到Key 中,Titile可以随便填写。最后 Add SSH Key。

这里写图片描述

6、测试ssh keys是否设置成功。

$ ssh -T git@github.com
  • 1
  • 1

$ ssh -T Git@github.com 
The authenticity of host ‘github.com (192.30.253.112)’ can’t be established. 
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. 
Are you sure you want to continue connecting (yes/no)? yes #确认你是否继续联系,输入yes 
Warning: Permanently added ‘github.com,192.30.253.112’ (RSA) to the list of know n hosts. 
Hi MariShunxiang! You’ve successfully authenticated, but GitHub does not provide shell access. #出现这句话,说明设置成功。

这里写图片描述

转载于:https://my.oschina.net/u/2958786/blog/861735

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐