ssh |osx

Unlocking your SSH key through OSX keychain

michalbryxi

Michal Bryxí

Posted on November 8, 2024

Unlocking your SSH key through OSX keychain

The problem

Using passphrases for SSH keys is a very good idea, but since UX is inherent part of security I would advise on adding your SSH key to the ssh-agent to prevent password re-type fatigue & mishaps.

The solution

Follow along the documents above or try this shortened version:

  1. Add following line to your ~/.zshrc:
ssh-add --apple-use-keychain ~/.ssh/id_rsa 2> /dev/null
Enter fullscreen mode Exit fullscreen mode
  1. Add following lines to yours ~/.ssh/config:
Host *
    UseKeychain yes
    AddKeysToAgent yes
    IdentityFile ~/.ssh/id_rsa
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
michalbryxi
Michal Bryxí

Posted on November 8, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related