首页 > 其他 > 详细

生成SSHkey并绑定到GitHub

时间:2018-11-28 10:34:10      阅读:122      评论:0      收藏:0      [点我收藏+]

Open Git Bash.

生成SSH key文件

$ ssh-keygen -t rsa -b 4096 -C "wwwlibaoshan12@163.com"
#.ssh文件保存在默认路径下,注意从上述命令的输出中,查看。
[本人路径保存在C:\Users\wwwli\.ssh]

查看存在的SSH Keys

$ ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist

添加SSH key添加到ssh-agent

#确认ssh-agent正在运行
$ eval $(ssh-agent -s)
Agent pid 28148
#添加SSH key私钥到ssh-agent
$ ssh-add ~/.ssh/id_rsa
Identity added: /c/Users/wwwli/.ssh/id_rsa (/c/Users/wwwli/.ssh/id_rsa)

添加SSH key到git账户

#将公钥复制到剪切板上
$ clip < ~/.ssh/id_rsa.pub
#这是你的剪切板上已经有公钥了

GitHub账号绑定公钥

技术分享图片

再依次单击|”SSH and GPG keys”|,|“New SSH key” |, 
输入|“Title”|,在key处粘贴上述剪切板的内容。 
单击“添加SSH key”

生成SSHkey并绑定到GitHub

原文:https://www.cnblogs.com/libaoshan/p/10030200.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!