Git SSH Key 生成步骤

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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容