I’m using Git Bash on Windows, and I'm trying to use the Windows OpenSSH agent to manage my SSH keys. Despite successfully starting the SSH agent as a service, I encounter the following error when trying to add my key or list loaded keys:
Error connecting to agent: No such file or directory
or
Could not open a connection to your authentication agent.
What I've Tried:
- Starting the SSH agent manually:
eval "$(ssh-agent -s)"
- The agent starts and shows a PID, but connecting to it fails.
- Verifying the agent is running via PowerShell:
Get-Service ssh-agent
- The service is running and set to automatic.
- Setting the
SSH_AUTH_SOCKmanually in Git Bash:
export SSH_AUTH_SOCK=/mnt/c/Users/chesswhiz/AppData/Local/ssh-agent.sock
- Still results in a "No such file or directory" error.
- Confirming the existence of the socket file using:
ls -l /mnt/c/Users/chesswhiz/AppData/Local/ssh-agent.sock
- The file does not exist or is not accessible from Git Bash.
Environment:
- Windows 10
- Git Bash (from Git for Windows)
- Windows OpenSSH client and agent installed
- The agent works properly when using PowerShell directly
Question:
How can I configure Git Bash to correctly connect to the Windows OpenSSH agent? Is there a way to make the agent socket accessible within Git Bash, or am I missing a crucial configuration step?
ssh-agent.exeingit-bashbundle?