如何生成GitHub上的SSH连接密钥

介绍:

GitHub是一个面向开源及私有软件项目的托管平台,因为只支持git 作为唯一的版本库格式进行托管,故名GitHub。一般来说,clone项目有两种方式:Https和SSH

 

如何生成GitHub上的SSH密钥?

第一步:

安装git.exe,打开Git Bash    安装了就忽略

如何生成GitHub上的SSH连接密钥_第1张图片

 

第二步:

输入指令,用自己之前注册GitHub账号的邮件账号生成SSH

双引号里是我的邮件账号

ssh-keygen -t rsa -C "[email protected]"

 

然后连续敲三次回车键,就生成密钥文件了

mocar@mocar MINGW64 ~
$  ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/mocar/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/mocar/.ssh/id_rsa.
Your public key has been saved in /c/Users/mocar/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:LD9a903FENaX3wOA4fd2NqDmqYcw33huDFNkUPA/inE mocar@mocar
The key's randomart image is:
+---[RSA 3072]----+
|  o+.  .. ... o..|
|   .o o  .   o oo|
|   +.+ .      o +|
|  . +.o.       +o|
| o..E++ S       +|
|= ++...+       . |
|.*.*.   + .   .  |
|o + =  o o . o   |
|.. +. .     . .  |
+----[SHA256]-----+

 

 

添加ssh key到GitHub

找到生成的这两个文件

路径:/c/Users/mocar/.ssh/id_rsa

 

打开GitHub添加设置生成的密钥

 https://github.com/settings/keys

如何生成GitHub上的SSH连接密钥_第2张图片

 

 

添加成功

如何生成GitHub上的SSH连接密钥_第3张图片

 

 

IDEA配置连接GitHub远程仓库

如何生成GitHub上的SSH连接密钥_第4张图片

如何生成GitHub上的SSH连接密钥_第5张图片

 

 

以上参考:

https://www.cnblogs.com/greattao/p/10310044.html

 

 

$ git clone [email protected]:gitrunning/MallProject.git
Cloning into 'MallProject'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

无权限,参考:

https://blog.csdn.net/wuli_smbug/article/details/81480162

你可能感兴趣的:(git)