Last active
May 2, 2024 06:39
-
-
Save adaam/0957ce8ca1666babd67a0c0d602016be to your computer and use it in GitHub Desktop.
Get ssh-agent SSH_AUTH_SOCK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search running ssh-agent | |
# Source: https://github.com/docker/for-mac/issues/6541#issuecomment-1304604625 | |
SSH_AGENT_PID="$(pgrep ssh-agent)" | |
SSH_AUTH_SOCK="$(lsof -p "${SSH_AGENT_PID}" | awk '/ unix / {print $8}') | |
export SSH_AGENT_PID SSH_AUTH_SOCK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac will automatic run it when system launch | |
# Source: https://stackoverflow.com/a/64023733/23585785, https://github.com/docker/for-mac/issues/4242#issuecomment-697197199 | |
export SSH_AUTH_SOCK=`launchctl getenv SSH_AUTH_SOCK` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment