生成SSHkey并绑定到GitHub

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”

转载于:https://www.cnblogs.com/libaoshan/p/10030200.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值