How to generate and add new ssh key

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Note: After adding the public key, access servers the next day.

Generate ssh key

Paste the text below, replacing the email used in the example with your GitHub email address.

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

Note: If you are using a legacy system that doesn't support the Ed25519 algorithm, use:

 ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Add ssh key to GitHub

cat ~/.ssh/id_xxx.pub

Copy the public key to your GitHub > Settings

Last updated