๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐–„๐•บ๐ŸŒŽ๐•ฟ๐•ฝ๐•บยฅ

๐•ด ๐–‰๐–” ๐–’๐–†๐–Œ๐–Ž๐–ˆ
github

Add SSH public key to GitHub

Preface#

The ssh key has expired again, and every time I need to re-add it, I have to refer back to the documentation. So, I decided to write a convenient guide for myself.

Steps#

Using Ubuntu as an example

$ ssh-keygen -t rsa -b 4096

Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
$ #Enter name
$ Enter passphrase (empty for no passphrase): Enter password
$ Enter same passphrase again: Re-enter password

If you press Enter directly at the name input, the following will be output

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: ....code..... root@system

Use the cat command directly

cat ~/.ssh/id_rsa.pub

Copy the output directly to the "Add new SSH Key" section on GitHub.

Testing#

$ ssh -T git@github.com

Issues#

There may be connectivity issues in China, you can try changing the DNS.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.