원클릭으로
find-ssh-agent
Find a forwarded SSH agent socket with live identities and set SSH_AUTH_SOCK
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Find a forwarded SSH agent socket with live identities and set SSH_AUTH_SOCK
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | find-ssh-agent |
| description | Find a forwarded SSH agent socket with live identities and set SSH_AUTH_SOCK |
First check the stable symlink that ~/.ssh/rc maintains on each inbound SSH connection:
sock=~/.ssh/ssh_auth_sock
if [ -S "$sock" ]; then
result=$(SSH_AUTH_SOCK="$sock" ssh-add -l 2>&1)
if echo "$result" | grep -qE "^[0-9]+ SHA256:"; then
echo "FOUND (stable symlink): $sock"
echo "$result"
fi
fi
If that works, skip the scan below and report the stable symlink as the winning socket.
If the symlink is missing or dead, scan all candidate sockets:
for sock in /tmp/ssh-*/agent.* ~/.ssh/agent/*; do
[ -S "$sock" ] || continue
result=$(SSH_AUTH_SOCK="$sock" ssh-add -l 2>&1)
if echo "$result" | grep -qE "^[0-9]+ SHA256:"; then
echo "FOUND: $sock"
echo "$result"
fi
done
Report every socket that returned at least one identity. For each, show the key fingerprints.
Then, for each socket found, test GitHub auth:
SSH_AUTH_SOCK=<socket> ssh -T git@github.com 2>&1
Report which socket authenticates successfully as the user.
Finally, output the exact export command the user should run (or that you should use for the remainder of this session) to make git operations work:
export SSH_AUTH_SOCK=<winning-socket>
Prefer ~/.ssh/ssh_auth_sock as the winning socket when it works — it stays valid across reconnections. If no socket is found with identities, say so clearly and suggest the user run ssh-add or check that agent forwarding (-A) is enabled in their SSH session.