继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Git创建一个SSH KEY

慕姐8265434
关注TA
已关注
手记 1147
粉丝 221
获赞 1064

一、Generating a new SSH key

  1. Open Git Bash.

  2. Paste the text below, substituting in your GitHub email address.

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

// 输入这句话,连按三个回车,直接跳过下面的步骤

This creates a new ssh key, using the provided email as a label.

Generating public/private rsa key pair.
  1. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

Enter a file in which to save the key (/c/Users/you/.ssh/id_rsa):[Press enter]
  1. At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

二、安装完成之后,输入命令 ll ~/.ssh 查看是否安装成功,出现 id_rsa(锁) 和 id_rsa.pub(钥匙) 成功

webp

三、出现锁之后,我们输入命令cat ~/.ssh/id_rsa.pub查看内容并上传github

webp

webp

四、创建完成之后我们可以测试一下

如果之前已经存在,输入命令rm ~./ssh/known_hosts删除之前的连接

输入命令测试连接
ssh -T git@github.com

webp

输入yes



作者:littleyu
链接:https://www.jianshu.com/p/3ba81ffd5046


打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP