Skip to content

SSH Key

Generate SSH key

in ~/.ssh directory
ssh-keygen -t ed25519 -C "your_email@example.com"

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"

Ensure the ssh-agent is running

eval "$(ssh-agent -s)"

## Agent pid 60501

Create SSH config file

~/.ssh/config
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Add key

ssh-add --apple-use-keychain ~/.ssh/id_ed25519

For older versions of MacOS

ssh-add -K ~/.ssh/id_ed25519
ssh-add ~/.ssh/id_ed25519