In a terminal session I can run launchctl getenv SSH_AUTH_SOCK
and it prints the value of that variable. However if I ssh into the same user from another computer, then run the same command, there is no output. I'd like to know how to make this work.
This is important to me because:
- my ssh keys have passphrases
- my terminal prompt includes bash-git-prompt
- this leads to the message
Enter passphrase for key [~/.ssh/...]:
being printed every time my prompt is written to the screen when I don't have access to the ssh agent socket. - launchd sets the ssh agent socket path so that it can use the fancy "only runs when needed" functionality of launchd, so I don't know the path ahead of time and it changes on reboot.