Skip to content

Commit ec88fc8

Browse files
Add Windows troubleshooting for SSH agent conflicts. (#42822)
Co-authored-by: Sharra-writes <sharra-writes@github.com>
1 parent eddecc9 commit ec88fc8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

content/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,21 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
162162
```powershell
163163
ssh-add c:/Users/YOU/.ssh/id_ed25519
164164
```
165-
166165
{% data reusables.ssh.add-public-key-to-github %}
167166
167+
> ### Troubleshooting SSH agent conflicts in Windows
168+
>
169+
> In Windows environments, the native Windows OpenSSH implementation and the one included with Git for Windows (based on MSYS2/Bash) can coexist.
170+
>
171+
> If you configure and save your passphrases in the Windows agent using PowerShell, Git may still prompt you for your passphrase during operations like `git push`. This can happen when Git for Windows uses its bundled `ssh.exe` (from MSYS2) instead of the Windows system OpenSSH client, and therefore can't talk to the Windows `ssh-agent` service.
172+
>
173+
> To ensure Git uses the agent where you've stored your credentials, force Git to use the system's SSH binary by running:
174+
>
175+
> ```powershell
176+
> git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
177+
> ```
178+
179+
168180
{% endwindows %}
169181

170182
{% linux %}
@@ -254,5 +266,7 @@ If you are using macOS or Linux, you may need to update your SSH client or insta
254266
> Enter passphrase (empty for no passphrase): [Type a passphrase]
255267
> Enter same passphrase again: [Type passphrase again]
256268
```
257-
269+
258270
{% data reusables.ssh.add-public-key-to-github %}
271+
272+

0 commit comments

Comments
 (0)