2
I want to set the value of SSH_AUTH_SOCK
to a different location on an OSX El Capitan system. I attempted to do so by executing the following command:
$ launchctl setenv SSH_AUTH_SOCK ~/.gnupg/S.gpg-agent.ssh
However, SSH_AUTH_SOCK
still holds the default value even after I restart the terminal:
$ echo $SSH_AUTH_SOCK
/private/tmp/com.apple.launchd.XXXXXXXXXX/Listeners
But interestingly, when I query the value of SSH_AUTH_SOCK
using launchctl
, I get the desired result:
$ launchctl getenv SSH_AUTH_SOCK
/Users/sora/.gnupg/S.gpg-agent.ssh
How can I correctly set the value of SSH_AUTH_SOCK
system-wide?
EDIT: SSH_AUTH_SOCK
was not set in any of the shell startup files (e.g. ~/.zshrc
, /etc/zshrc
, /etc/zprofile
)
Did you try to re-login or reboot? – Jakuje – 2016-09-03T06:06:29.030
@Jakuje Yes, but the problem persisted after reboot. – Sora Minazuki – 2016-09-03T13:10:30.963
1Run into absolutely same issue! I know it's 2 years old question, but did you manage to solve it? This still persists on High Sierra. So weird... Even Apples launchd doesn't work on their own OS as expected... – Drew – 2018-06-06T23:56:43.003
Unfortunately, I haven't been able to find a direct solution. However, it is possible to work around this particular problem by using the
– Sora Minazuki – 2018-06-07T01:20:15.137IdentityAgent
option in SSH_CONFIG.