When I run (getenv "SSH_AUTH_SOCK")
, I get "/private/tmp/com.apple.launchd.K9OEFgxDgw/Listeners"
.
I want to set it to the value that is returned by echo $SSH_AUTH_SOCK
on the command line which is something like /tmp/ssh-P7OPvY12nTFk/agent.35299
Unfortunately, (shell-command-to-string "echo $SSH_AUTH_SOCK")
also returns "/private/tmp/com.apple.launchd.K9OEFgxDgw/Listeners"
.
How can I set SSH_AUTH_SOCK
to /tmp/ssh-XXXXXXXXX/agent.YYYYY
?
The background is that I want Magit to be aware of the SSH agent I'm running so I can connect to Bitbucket repositories.
EDIT: I solved my problem by using the Keychain tool and keychain-environment for Emacs (see this answer by the Magit author).
--no-init
,(shell-command-to-string "SSH_AUTH_SOCK")
picks up the SSH agent socket under/tmp
. You're right at in the long term, I should figure out how to add Bitbucket to macOS system agent.