I'm trying to set up gpg-agent as the common authentication agent under Windows. It works fine for both Putty and regular gpg use, but now I'd like to use it as ssh-agent in git bash as well.

From what I've gathered, it should be sufficient to use

export GPG_AUTH_SOCK=~/AppData/Roaming/gnupg/S.gpg-agent.ssh
export GPG_AGENT_PID=$$

I can't use the real agent PID here, because the abstraction layer will hide processes outside the msys environment, so I use the shell's PID.

The gpg agent has been started with the enable-ssh-support and enable-putty-support options, and the agent socket is properly created. However, ssh-add claims that it cannot connect to the agent.

What is the correct way to introduce the running gpg-agent as the ssh agent into a new git bash?

  • How are you starting/launching this "new git bash"?
    – Eduardo
    Commented Nov 10, 2015 at 16:30
  • Either way behaves the same -- context menu on folder, start menu, ... I get the same behaviour running git from cmd.exe directly (in which case I use set to create the environment variables). Commented Nov 10, 2015 at 17:15
  • @SimonRichter, did you make any progress with this? I've been trying to start the gpg-agent daemon through git bash on Windows, but it fails miserable with: ERR 67109139 Unknown IPC command <GPG Agent>. Did you get that error too?
    – dSebastien
    Commented Nov 28, 2017 at 14:37


You must log in to answer this question.

Browse other questions tagged .