Hello guys,
I've recently ran into this problem where more or less every now and then I can't use git push, I get this error message:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I try to add my public key, I get this error:
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.
After some google:ing, I found I have to start the ssh-agent first:
$ eval $(ssh-agent)
$ ssh-add ~/.ssh/id_rsa
I tried adding those lines to after.sh found in the C:\Users\<user>\.homestead folder and I can see it running when I boot vagrant:
homestead-7: Running: script: Update Composer
==> homestead-7: You are already using composer version 1.3.2 (stable channel).
==> homestead-7: Running provisioner: shell...
homestead-7: Running: E:/Dropbox/Programs/ConEmu/Data/Temp/vagrant-shell20170128-4104-1vsi5bt.sh
==> homestead-7: Agent pid 3711
==> homestead-7: Identity added: /home/vagrant/.ssh/id_rsa (/home/vagrant/.ssh/id_rsa)
Z:\Work\Homestead>
..but it still doesn't work when I SSH in. I have to run it manually..
Any thoughts how I can stop ssh-agent from dying?
PS. I'm on Windows 10