“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..”
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:
- Install and use PuTTY for a number of years.
- Use it to connect to a Linux server via ssh key.
- 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.
- 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:
- Start PuTTY.
- Find session saved under the name equal to fully qualified domain name for the server.
- 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.
- You may also simply delete that offending PuTTY session.
Alternatively, you might address that via regedit:
- Navigate to the node HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions
- 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).
- http://stackoverflow.com/questions/5358804/tortoisegit-using-incorrect-ssh-key (We did not need to read this to solve the trouble. It is just for illustration that the bug with key preference from PuTTY registry was mentioned more than 3 years ago and still is not fixed in latest TortoiseGit version from November 2015).