So I know apple changed how they handled ssh keys in their keychain when they went to Sierra, but I wanted to understand if there's a resolution to the following issue. I have a High Sierra MacOS machine that sometimes I work at in person and sometimes I access remotely via ssh. If I am at the machine itself and perform some action using its ssh keys (i.e., git pull/push), everything works as expected, as it has the passphrase in the keychain the High Sierra way. However, if I ssh in, the MacOS key agent is not getting loaded so if I perform the same git push/pull actions, it asks me for the passphrase. Other than manually starting eval "$(ssh-agent -s)"
each time I ssh in, is there a way to get to get it to stop asking for my passphrase?
Asked
Active
Viewed 213 times
0

user2379888
- 1,145
- 1
- 10
- 16
1 Answers
1
You could add a check in your .bash_profile
to do the eval automatically
if [[ "$SSH_AGENT_PID" == "" ]]; then
eval "$(ssh-agent -s)"
fi
Or, if your SSH Key of the system you are using to SSH into the mac is able to push to git, you can setup ssh key forwarding. That way you will use your host SSH Key.
To do that, add this to your ~/.ssh/config
on the host.
Host *
ForwardAgent yes

lukas-reineke
- 3,132
- 2
- 18
- 26