TortoiseGit SSH client change: moving from TortoiseGitPlink to OpenSSH breaks production authentication
0 reputation · 02 Apr 2022, 01:51 UTC
0 reputation · 02 Apr 2022, 01:51 UTC
A Windows workstation authenticates to a Git remote over SSH without issues when using TortoiseGit, but the same repository and credentials fail on a production or CI machine. The suspected boundary is the SSH client configured under TortoiseGit Settings > Network > SSH client.
By default TortoiseGit ships TortoiseGitPlink, a PuTTY derivative that expects .ppk keys loaded in Pageant and maintains its own host-key cache. Git for Windows, by contrast, typically uses its bundled OpenSSH ssh.exe, which reads keys from ~/.ssh and consults known_hosts. A local machine may also carry a GIT_SSH environment variable or a core.sshCommand override that silently masks which client is actually used, so the two environments can diverge without any visible configuration difference in the repository itself.
There is also a non-interactive concern: TortoiseGitPlink prompts to cache an unknown server host key on first connection, which cannot be answered in an unattended production session. Key-type support such as ed25519 varies by the bundled Plink version, so the deployed TortoiseGit release matters.
Given that the SSH client setting is per-installation rather than per-repository, which standardization approach is more maintainable for a mixed team: pointing TortoiseGit at ssh.exe everywhere, or keeping the PuTTY/Pageant key infrastructure?
What is the reliable way to confirm which SSH client and key store each machine is actually using before changing the setting?
35775 reputation · 02 Apr 2022, 13:03 UTC
On a workstation TortoiseGit often talks to a remote via TortoiseGitPlink, which pulls keys from Pageant and keeps its own host‑key cache in the registry. In a CI job the same repository is usually accessed by the command‑line git, which defaults to the OpenSSH ssh.exe bundled with Git for Windows. Because the two clients look in different places for keys and host keys, the same credentials can succeed in one environment and fail in another.
Settings > Network > SSH client. Note the full path shown. If it points to plink.exe (or a custom path), TortoiseGit will use that binary.where.exe plink.exe (or the path you saw) from a command prompt in the same user session to ensure the executable is reachable.git config --show-origin --get-all core.sshCommand. If a value appears, it overrides the default.GIT_SSH_COMMAND and GIT_SSH.git config --global --show-origin core.sshCommand and git config --system --show-origin core.sshCommand to see if a global or system setting is in place.GIT_TRACE=1 GIT_SSH_COMMAND=\"ssh -v\" git ls-remote [contact removed]:org/repo.git
The trace will print the path of the binary that Git invoked, the key files it offered, and the host‑key check it performed. Look for lines like debug1: Reading configuration data /c/Users/me/.ssh/config to confirm the OpenSSH client, or debug1: Reading configuration data /c/Users/me/.ssh/ssh_config for PuTTY‑style config if you are using plink with its own config file.
%USERPROFILE%\\.ssh\\known_hosts.HKCU\\Software\\SimonTatham\\PuTTY\\SshHostKeys.If the server’s key appears only in the registry entry, Plink has connected before; if it’s only in known_hosts, OpenSSH has. A missing entry in both indicates the host has never been seen by either client.
Run ssh -v [contact removed] (or the remote host) from the same user session. If the connection succeeds, the key is available to OpenSSH. For Plink, run plink -v [contact removed] and watch for the Authentication succeeded message.
Does the CI job run under a user session that has Pageant or ssh-agent active, or is it executed as a Windows service? This affects whether a PuTTY‑based workflow can work in CI and may change the recommendation.
For a mixed team that uses both GUI workflows and automated CI, pointing every installation of TortoiseGit to the Git for Windows ssh.exe is the most maintainable path. It keeps key management in plain files (~/.ssh/id_* and known_hosts), which Git, TortoiseGit, and CI all read consistently. Moving to PuTTY/Pageant only makes sense if the organization already relies on .ppk keys, hardware tokens, or a Pageant‑based agent that cannot be replicated in CI.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.