I have been trying to set up Cmder to use ssh-agent for authentication, and so far it seems that Cmder itself is using it fine, but when I call git, it ignores ssh-agent entirely.
OS: Windows 11 (22H2)
SSH: OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
Cmder, etc.: up to date
I have loaded a couple keys into ssh-agent, and running
When I run
This successfully completes and I get this message at the end:
So, this part is alright. However, if I try to use any git commands, it does not attempt any keys from ssh-agent. I changed
I also updated
Now when I run
It's definitely reading the configuration files. But it's still ignoring ssh-agent.
The verbose output has no references to the keys stored in ssh-agent. So in the end I get
What am I missing? How do I get git under Cmder to pay attention to ssh-agent?
PS I first posted on Cmder's github page in the discussions section, but that page gets very little fraction, so I'm cross-posting here. I know that's somewhat out of decorum. If either venue gets a resolution, I'll copy that to the other.
OS: Windows 11 (22H2)
SSH: OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
Cmder, etc.: up to date
I have loaded a couple keys into ssh-agent, and running
ssh-add -l
returns the expected result, listing the loaded keys.When I run
ssh -v git@github.com
, the output includes the expected references to the loaded keys:
Code:
debug1: Will attempt key: ndc\\xxx@yyy RSA SHA256:[redacted] agent
debug1: Will attempt key: ndc\\xxx@yyy RSA SHA256:[redacted] agent
This successfully completes and I get this message at the end:
Code:
Hi borisgred! You've successfully authenticated, but GitHub does not provide shell access.
So, this part is alright. However, if I try to use any git commands, it does not attempt any keys from ssh-agent. I changed
~cmder\vendor\git-for-windows\etc\gitconfig
so that sshCommand = ssh -v -A
, to see verbose output. I also edited ~cmder\vendor\git-for-windows\etc\ssh\ssh_config
adding this section:
Code:
# Github
Host github.com
HostName github.com
PreferredAuthentications publickey
ForwardAgent yes
I also updated
~\.ssh\config
with this section:
Code:
# Github
Host github.com
ForwardAgent yes
Now when I run
git clone git@github.com:borisgred/sda.git
I get the verbose output. I see these lines appear:
Code:
debug1: Reading configuration data /c/Users/xxx/.ssh/config
debug1: /c/Users/xxx/.ssh/config line 2: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for github.com
It's definitely reading the configuration files. But it's still ignoring ssh-agent.
The verbose output has no references to the keys stored in ssh-agent. So in the end I get
git@github.com: Permission denied (publickey)
. And that's the end.What am I missing? How do I get git under Cmder to pay attention to ssh-agent?
PS I first posted on Cmder's github page in the discussions section, but that page gets very little fraction, so I'm cross-posting here. I know that's somewhat out of decorum. If either venue gets a resolution, I'll copy that to the other.