DEV Community

Cover image for Unlocking your SSH key through OSX keychain
Michal Bryxí
Michal Bryxí

Posted on

1

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

Reinvent your career. Join DEV.

It takes one minute and is worth it for your career.

Get started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay