Git SSH Key 生成步骤
2017-07-14 本文已影响0人
Kevin1996cn
1. 检查是否已经有SSH Key。
$cd ~/.ssh
如果说没有这个目录,就直接看第三步
2. 备份
3. 生成一个新的SSH。
$ ssh-keygen -t rsa -C "email"
之后直接回车,不用填写东西。
之后会让你输入密码。然后就生成一个目录.ssh ,里面有两个文件:
id_rsa , id_rsa.pub
4. 把这个SSH放到github上。
用公钥。先在GitHub上注册一个用户,然后进入account-setting ,把id_rsa.pub的内容复制进去就可以了。
5.测试
$ ssh git@github.com
The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.ERROR: Hi Kevin You’ve successfully authenticated, but GitHub does not provide shell accessConnection to github.com closed.