Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
657 B

#!/bin/bash
# This is a hacky effort at showing what SSH agents are running and what keys
# they're holding. It... Sorta works, maybe, including for agents started
# by sshecret, but I am not overwhelmingly confident in it.
# https://github.com/wwalker/ssh-find-agent might be a more robust alternative
# to this.
function sockets {
THE_UID="$(id -u)"
find /tmp -uid "$(id -u)" -type s -name "agent.*" 2>/dev/null
find "/run/user/$THE_UID/" -type s -name "*.sock" -maxdepth 1 2>/dev/null
}
for socket in $(sockets); do
if [ X"$socket" != X ] ; then
export SSH_AUTH_SOCK="$socket"
fi
echo "$SSH_AUTH_SOCK"
ssh-add -l
echo
done