Skip to content

Instantly share code, notes, and snippets.

@pH-7
Last active May 26, 2023 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pH-7/f8569ed659757846a837141beaedd18f to your computer and use it in GitHub Desktop.
Save pH-7/f8569ed659757846a837141beaedd18f to your computer and use it in GitHub Desktop.
How to setup SSH key for the first time on your Mac OS

Setup your SSH key

How to setup SSH key for the first time on your Mac OS

To setup your SSH key on your computer

  1. Type ssh-keygen -t ed25519 -C "<YOUR_NAME>@zambrero.com"
  2. Create a SSH config file to automatically load keys into the ssh-agent and store passphrases in your keychain
    touch ~/.ssh/config
  3. Open the config file with your default text editor open ~/.ssh/config on Mac
  4. Paste the following
Host github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519
  1. Add your SSH private key to the ssh-agent and store your passphrase in the keychain ssh-add --apple-use-keychain ~/.ssh/id_ed25519
  2. Add the SSH key to your GitHub or Bitbucket account.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment