Config Github with SSH

Posted by yaohong on Friday, November 20, 2020

TOC

Config Github with SSH

Generating a new SSH key

1.Open TerminalTerminalGit Bash.

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

$ ssh-keygen -t ed25519 -C "your_email@example.com"

3.Then you’re prompted to do something, press Enter.

Then the keys will be saved under ~/.ssh folder.

You can use ls -al ~/.ssh command to see them.

LOG:

$ ssh-keygen -t ed25519 -C "my_email@example.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/c/Users/myusername/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/myusername/.ssh/id_ed25519.
Your public key has been saved in /c/Users/myusername/.ssh/id_ed25519.pub.

Config github key

Copy gitbash:

clip < ~/.ssh/id_ed25519.pub

Open the url “https://github.com/settings/keys" in browser, then click New SSH Key, input a title, and paste your key into the “key” field.

Enviroment:

git --version
git version 2.18.0.windows.1

REFERENCE:

Generating a new SSH key

Checking for existing SSH keys

「点个赞」

Yaohong

点个赞

使用微信扫描二维码完成支付