Skip to content

Instantly share code, notes, and snippets.

@dmunozgaete
dmunozgaete / README.md
Created October 28, 2023 19:38 — forked from darrenpmeyer/README.md
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

Keybase proof

I hereby claim:

To claim this, I am signing this object: