Unlocking your SSH key through OSX keychain
Michal Bryxí

Michal Bryxí @michalbryxi

About: Cycle 🚴 , climb 🗻 , run 🏃 , travel 🌍 , enjoy life ♥. IT guy with the need to live fully.

Location:
Interlaken, Switzerland
Joined:
Feb 1, 2018

Unlocking your SSH key through OSX keychain

Publish Date: Nov 8 '24
3 0

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

Comments 0 total

    Add comment