Configure public key authentication on Windows

Genero Studio can support public key authentication on Windows® if you use Pageant.

Pageant is a utility that stores unencrypted private keys in memory and provides digital signatures when needed. You have to install PuTTY on your client machine to use it.

You configure it by giving the path of the encrypted private key file (See PuTTY documentation for more information). You enter the passphrase just once when Pageant is launched; then you will not have to bother with it again, until you launch a new Windows session.

Genero Studio uses plink to initiate an ssh connection. If Pageant is launched, plink automatically uses Pageant to get a signature. When using public key authentication in Genero Studio, don't fill in the password field in the SSH connection dialog, as it not used.

Pageant

First, you have to generate a pair of private\public keys. If you already have a SSH\OpenSSH key pair, see the How to use openSSH keys with Pageant section.

  • Launch PuTTYgen, and verify that the SSH-2 RSA radio button is selected.
  • Select the number of bits you want as the size for the key and click the Generate button. During generation, move cursor into the blank area to randomize the keys.
  • Enter a comment to identify the key pair more easily.
  • Enter a passphrase. A passphrase is used to decrypt the private key (Private key is encrypted on the disc for more security). Don't forget it, you will have to enter it each time you begin a new Windows session.
  • Once you have entered the passphrase, you can save the private and public keys on the disc.
Figure: PuTTY Key Generator

This figure is a screenshot of the PuTTY Key Generator.
  • Next, go to your home directory (/home/username) on your host machine, and edit the .ssh/authorized_keys file with your preferred text editor. If the file (or .ssh directory) doesn't exist, create it.
  • Copy your generated public key in the authorized_keys file. The key must be in exactly the same format as displayed in PuTTYgen (ssh-rsa ****...****== keyname) and must occupy only one line. If several lines were already present, enter a line return before writing the key.
  • Now launch Pageant. It will appear in the systray as a desktop computer wearing a hat. Right click on it and select Add key.
Figure: Pageant pop-up menu.

This figure is a screenshot of a Pageant pop-up menu. Add Key is a menu option.
  • An open file dialog lets you select a ppk (Private key) file. After selecting it, you will be asked to enter the corresponding passphrase.
  • You can verify that the key has been successfully added by selecting "View keys" in the Pageant icon's context menu. The key signature is displayed instead of the private key, but you can recognize it by its name.

You should now be able to initiate an ssh connection with Genero Studio without entering a password.

How to use openSSH keys with Pageant

The ssh-keygen generated private key files cannot be directly used by Pageant; you have to convert them into .ppk files. To do so, open PuTTYgen and select Conversions>>Import key menu item; select your OpenSSH format private key.