PuTTY - SSH, it's a secret !!!

mail

Convert SSH public keys between PuTTY and OpenSSH formats

ssh-keygen -i -f publicKeyInPuTTYFormat > publicKeyInOpenSshFormat

mail

How to run a graphical application remotely via PuTTY and Xming ?

  1. You need Xming installed, configured and running on the host that will display the application window.
  2. Prepare to open a new SSH connection via PuTTY (but don't open it yet). Specify host, port, login name, ..., accordingly.
  3. Then, still in the PuTTY configuration window : open the Connection | SSH | X11 page and tick Enable X11 forwarding.
  4. On the same page, for the X display location, enter 127.0.0.1:0.
  5. Now, start the SSH connection with .
  6. Once logged in, you just have to launch the application the way you would do it locally.
mail

How to recover from CTRL-s in PuTTY ?

Situation

I'm a CTRL-s maniac : as soon as I've typed a few words, modified a few things, or prepare to switch windows, I hit these keys (or sometimes CTRL-x s because I'm also an Emacs enthusiast ;-).

Details

But PuTTY is one exception : CTRL-s (and CTRL-x s) have a special meaning and hitting these keys will freeze the display, while PuTTY will keep on reading the keyboard and responding to entered commands.

Solution

To unfreeze the display : CTRL-q
mail

How to disable the auto scroll down feature of the PuTTY window while trying to read past commands ?

  1. Right click the title bar of the PuTTY session window and select Change settings
  2. Select the Window category
  3. Untick the Reset scrollbar on display activity option
  4. Enjoy
mail

PuTTY error : Proxy error 412 : precondition failed

Situation

While trying to open a PuTTY session through a corporate proxy, PuTTY complains Proxy error 412 : precondition failed.

Details

You can read more about the HTTP 412 status code, even though this seems unrelated here.

Solution

Actually, this occurred after being logged out without notice by the proxy. Had to open Internet Exploiter (corporate tool for web browsing / proxy usage) to request the login window, and voila.
mail

How to use function keys during a PuTTY session ?

To do so, you can either : Then :
  1. Open the Terminal | Keyboard page
  2. In the The Functions keys and keypad, select VT100+
  3. Then Apply
mail

How to dump and restore settings : FileZilla, PuTTY, WinSCP ?

FileZilla

Windows version :

Looks like everything can be found in C:\Users\bob\AppData\Roaming\FileZilla. FileZilla has backup/restore menu entries, use them

Linux version :

PuTTY & WinSCP :

Settings are stored in the Windows registry.

Dump :

  • Solution 1 :
    1. Open the Windows registry editor : [WINDOWS]-r regedit
    2. Navigate to the registry key
    3. Right-click on it then Export.
  • Solution 2, run this command : regedit /e "file.reg" "registryKey"
    • PuTTY : regedit /e "%userprofile%\bureau\putty.reg" "HKEY_CURRENT_USER\Software\SimonTatham" (source)
    • WinSCP : regedit /e "%userprofile%\bureau\winscp.reg" "HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2" (source)
    Depending on the Windows language, the desktop directory may be called desktop, bureau, or anything else

Restore :

Right-click the dump file, then Merge.

mail

Convert SSH private keys between PuTTY and OpenSSH formats

Usage

This can be achieved with the putty-tools package. We use, by convention :

File Usage
id_rsa.ppk private key file, in PuTTY format (Putty Private Key)
id_rsa private key file, in OpenSSH format
id_rsa.pub public key file, in both formats

Flags

Flag Usage
-O outputFormat Specify the Output format :
  • private : Save the private key in a format usable by PuTTY.
  • private-openssh : SSH-2 private key in OpenSSH's format
-o outputFile (explicit)

Example

PuTTY to OpenSSH format :

puttygen id_rsa.ppk -O private-openssh -o id_rsa

OpenSSH to PuTTY format :

puttygen id_rsa -O private -o id_rsa.ppk