I’ve been primarily a Linux/Mac OS X-based developer for the last year or so. However, I recently moved back to Microsoft and so figured that I should refamiliarize myself with Windows development. I have, of course, become completely dependent upon the standard tools such as ssh. Being the security-minded fellow I am, I will continue to fanatically refuse to use ssh with password-based authentication instead of public-private key pairs. While ports of all these tools, of course, exist for Windows, it is not always so straightforward to use them in what is a completely natural way. Here I will describe in detail my experiences setting up Mercurial over ssh with passwordless authentication and encryption. I’m going to use TortoiseHg since it includes PuTTY, which is a fairly nice Windows implementation of ssh. While these steps have been detailed many times before, I will repeat them here for anyone who’s interested.
tortoisehg-1.1.7-hg-1.7.2-x64.msi from hereplink.exe from hereputty.exe from hereputtygen.exe from heresshd and password-based authentication disabledputtygen.exeSSH-2 RSA and enter 2048 in Number of bits in a generated keyGenerateKey passphrase and Confirm passphraseSave public key and Save private keyPublic key for pasting into OpenSSH authorized_keys fileauthorized_keys in the .ssh directoryMercurial.ini file in your home directory with the following content:[ui]
ssh = TortoisePlink.exe -i "C:/path/to/ppk-file.ppk"Pageant.exe (which has equivalent functionality to OpenSSH’s ssh-agent)Content © 2025 Richard Cook. All rights reserved.