Archive for the ‘Mac’ Category

Setup SSH keys on Mac

Tuesday, July 26th, 2016

Generate SSH keys, defaults at ~/.ssh/id_rsa and id_rsa.pub

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Run Mac’s ssh-add command (not ssh-agent), adds default keys if no key is specifed, -K adds passphrases to keychain.

ssh-add -K

Create a text file called ~/.ssh/config with this content:

Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_rsa