linux git 六 远程仓库

ssh -keygen -t rsa -C “youremail” 创建密匙

1 创建SSH Key
在用户主目录下,看看有没有.ssh目录,再看看这个目录下有没有id_rsa和id_rsa.pub,这两个文件这两个就是SSH Key的秘钥对,id_rsa是私钥,id_rsa.pub是公钥。如果没有,打开Shell,创建SSH Key:

[root@localhost ~]# cd ~
[root@localhost ~]# ll
总用量 44
drwxr-xr-x.  3 root root    18 11月 12 15:58 222
drwxrwxr-x. 29 root root 24576 11月 11 16:32 git-2.29.2
-rw-r--r--.  1 root root    25 11月  7 22:18 wang.sh
[root@localhost ~]# ssh-keygen -t rsa -C "2291106509@qq.com"                  (生成秘钥)
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:9aHRFRSDQMamxmcF8WAR6xQgPocl8mxsbHCRpS3VuI0 2291106509@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|    o =+=*%* o*o |
|     X.O.o+*o. . |
|      #.o*=.+    |
|     + +E+++ .   |
|       .Soo .    |
|                 |
|                 |
|                 |
|                 |
+----[SHA256]-----+
[root@localhost ~]# 

2 登陆Github
打开“Account settings”,“SSH Keys”页面:

然后,点“Add SSH Key”,填上任意Title,在Key文本框里粘贴id_rsa.pub文件的内容
点“Add Key”,你就应该看到已经添加的Key:

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值