Skip to content

Commit 3d49394

Browse files
InfinitaySharra-writesCopilotsubatoi
authored
Add ssh-keygen troubleshooting info for Windows (#43714)
Co-authored-by: Sharra-writes <sharra-writes@github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ben Ahmady <32935794+subatoi@users.noreply.github.com>
1 parent 81ade08 commit 3d49394

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
167167
168168
> ### Troubleshooting SSH agent conflicts in Windows
169169
>
170-
> In Windows environments, the native Windows OpenSSH implementation and the one included with Git for Windows (based on MSYS2/Bash) can coexist.
170+
> In Windows environments, the native Windows OpenSSH implementation and the one included with [Git for Windows](https://gitforwindows.org/) (based on MSYS2/Bash) can coexist.
171171
>
172172
> 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.
173173
>
@@ -176,6 +176,14 @@ Before adding a new SSH key to the ssh-agent to manage your keys, you should hav
176176
> ```powershell
177177
> git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
178178
> ```
179+
>
180+
> You may need to specify which `ssh-keygen` binary Git should use to avoid conflicts with the binary bundled with Git for Windows. To define which binary is used, run the following command:
181+
>
182+
> ```powershell
183+
> git config --global gpg.ssh.program "C:/Windows/System32/OpenSSH/ssh-keygen.exe"
184+
> ```
185+
>
186+
> Alternatively, you can reinstall Git for Windows and select the **Use external OpenSSH** option during the installation process.
179187

180188

181189
{% endwindows %}

0 commit comments

Comments
 (0)