• Stars
    star
    436
  • Rank 99,877 (Top 2 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 13 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tool to find already running ssh-agent compatible agents

ssh-find-agent

ssh-find-agent is a tool for locating existing ssh compatible agent processes (e.g., ssh-agent, gpg-agent, gnome-keyring, osx-keychain); and, optionally, setting SSH_AUTH_SOCK accordingly.

Build Status

Build Status

Usage

Somewhere in shell initialization (~/.bashrc or ~./.zshrc)

source ssh-find-agent.sh # for bash
emulate ksh -c "source ssh-find-agent.sh" # for zsh

Add the following to automatically choose the first agent

ssh-add -l >&/dev/null || ssh-find-agent -a || eval $(ssh-agent) > /dev/null

To choose the agent manually run

ssh-find-agent -c

NOTE: The choose option is Useful when you actually want multiple agents forwarded. E.g., while pairing.

To list the agents run

ssh-find-agent -l

This will return a list of export commands that can be used to set the socket.

Should this output be executed it will set the socket to the last agent found.

eval $(ssh-find-agent -l)

Status

Alternatives