This is my first blog post.

I need this regularly, but to enough to memorize, specially the "adding to the ssh-agent".

I took this sample from Github, although Bitbucket used to have some nice docs on this matter.

ssh-keygen -t ed25519 -C "[email protected]"

then

eval "$(ssh-agent -s)"

Open ~/.ssh/config and add:

Host host.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/key_created

Finally:

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

For the key be use in the remote host, run locally:

cat ~/.ssh/key_created | pbcopy