Generate SSH Keys Locally

2022-03-30

It’s often necessary to generate a SSH key. Here is how to do it from the terminal.


Just run:

ssh-keygen -t ed25519 -C “your_email@example.com”

On a Mac, this will store the newly generated public and private keys in ~/.ssh.

You can copy the public key to the clipboard using:

cat ~/.ssh/id_rsa.pub|pbcopy

See here for more info.

Add SSH key to GitHub account Adding a new SSH key to your GitHub account