Menu Categories Author

Nubis Novem

Consulting On Cloud Nine

Git blues: TortoiseGit client under Windows fails to connect using SSH key

“Simon Tatham is a British programmer known primarily for creating and maintaining PuTTY, a free software implementation of Telnet and SSH clients for Unix and Windows API platforms..”
Wikipedia

It is a weird way to learn name of Putty author (may he prosper in his days). We had to learn it today hacking Windows registry to troubleshoot a Git client issue. Following scenario causes an annoying situation, apparently with a wrong user key association in a saved Putty session that gets in a way of TortoiseGit settings:

  1. Install and use PuTTY for a number of years.
  2. Use it to connect to a Linux server via ssh key.
  3. Install TortoiseGit client on Windows and try to connect to that same server via ssh:// URL to access Git repository but with a different private key for a different user id.
  4. You will find yourself in a loop of endless unsuccessful attempts to connect to the repository. Tortoise client would first ask for key password, then apparently it would fail to access git resources (indicating later that “Server refused our key”). Then TortoiseGit (or, to be exact TortoiseGitPlink program used behind TortoiseGit as a SSH client) would ask for a regular interactive password and fail again because key password did not work also for server access.

The issue happens because PuTTY user key stored in Windows registry under saved sessions with that server host name takes precedence over the key configured in Tortoise (why, oh why).

Here is how to fix it:

  1. Start PuTTY.
  2. Find session saved under the name equal to fully qualified domain name for the server.
  3. Rename that session name to something else. For instance, the session name was “myserver.host.net“, renaming it to just “myserver” fixed the TortoiseGit access trouble for us.
  4. You may also simply delete that offending PuTTY session.

Alternatively, you might address that via regedit:

  1. Navigate to the node HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions
  2. Find FQDN of the server used as the session name and rename or delete that session.

After the offending session was neutralized, TortoisePlink client would work smoothly from that moment and for as long as server remains online (may it prosper in its days).

References

Leave a Reply

Your email address will not be published. Required fields are marked *