Skip to content

Tool to find already running ssh-agent compatible agents

Notifications You must be signed in to change notification settings

vulk/ssh-find-agent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 

Repository files navigation

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.

Usage

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

. ssh-find-agent.sh

Add the following to automatically choose the first agent

ssh-find-agent -a
if [ -z "$SSH_AUTH_SOCK" ]
then
   eval $(ssh_agent) > /dev/null
   ssh-add -l >/dev/null || alias ssh='ssh-add -l >/dev/null || ssh-add && unalias ssh; ssh'
fi

To choose the agent manually run

ssh-find-agent -c

To list the agents run

ssh-find-agent

NOTE: The choose option is Useful when you actually want multiple agents forwaded. eg. pairing

Status

Alternatives

About

Tool to find already running ssh-agent compatible agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%