Skip to content

SSH Cheat Sheet

River News edited this page Dec 29, 2021 · 4 revisions

Quick steps

  1. Generate a key (refer to SSH official website for what ed25519 is, what algorithm to choose, what is other arg options): ssh-keygen -t ed25519 -C [email protected].
  2. For now on refer to GitHub instruction. Run eval "$(ssh-agent -s)".
  3. Create SSH config file if not yet created at ~/.ssh/config. Make sure to change ~/.ssh/id_ed25519 if using another file name in step 1.
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519
  1. Adding Apple support: ssh-add -K ~/.ssh/id_ed25519 (macOS Monterey suggest you to use ssh-add --apple-use-keychain ~/.ssh/id_ed25519 instead), make sure to change the file name.
  2. Ready to copy paste the SSH key on GitHub, or any website or client you're going to use SSH for auth / git clone. Run pbcopy < ~/.ssh/id_ed25519.pub, make sure to change the file name.
  3. Paste to add SSH key on the website / client.

You should now be able to git clone, etc.

Clone this wiki locally