Githup仓库使用密匙连接(win10使用cmd通过ssh远程免密登录linux)

 

 Githup仓库使用密匙连接

本地库生成密匙

 

$ git config --global user.name LIRUILONGS
$ git config --global user.email 1224965096@qq.com
$ ssh-keygen -t rsa -C "1224965096@qq.com"
 

 

lenovo@Liruilong MINGW64 /d/node/code/VueDemo (main)
$ git config --global user.name LIRUILONGS

lenovo@Liruilong MINGW64 /d/node/code/VueDemo (main)
$ git config --global user.email 1224965096@qq.com

lenovo@Liruilong MINGW64 /d/node/code/VueDemo (main)
$ ssh-keygen -t rsa -C "1224965096@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/lenovo/.ssh/id_rsa):
Created directory '/c/Users/lenovo/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/lenovo/.ssh/id_rsa.
Your public key has been saved in /c/Users/lenovo/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:QdyY4AUR/wU8De5ZF7/6GagKvd6ejzRYlNCkQtJvR+8 1224965096@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|     .*Bo*=+  .  |
|     .o=+.*+o  o |
|      ..+.o++ . .|
|        .*.= o  .|
|        S =..  . |
|        . o  Eo  |
|       . o o o . |
|        . + = . o|
|        .+o*.. o |
+----[SHA256]-----+

lenovo@Liruilong MINGW64 /d/node/code/VueDemo (main)

找到密匙复制到Githup上

 

$ cd ~/.ssh/
$ cat id_rsa.pub

 

 

 

 


$ cd ~/.ssh/
lenovo@Liruilong MINGW64 ~/.ssh
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EA3434ABAAABAQCkrUaQU/Li1cY3z0TTWrO34339fhYRlCNvPxkqEXcNLr343
lenovo@Liruilong MINGW64 ~/.ssh
$ pwd
/c/Users/lenovo/.ssh
lenovo@Liruilong MINGW64 ~/.ssh
 

 

 

 

 win10使用cmd通过ssh远程免密登录linux

将 id_rsa.pub的内容复制到linux的authorized_keys就可以了

 

 

 

posted @ 2021-05-05 10:03  山河已无恙  阅读(325)  评论(0编辑  收藏  举报