When connecting from a Windows client to a NIX server via ssh / sftp / scp, the usage of ssh keys would come in handy. The generation of a ssh keypair, will cause two keys to be generated. One private key, and one public key. The private key stays with you / your machine, and the public key is placed on the various NIX servers you connect to.
In the case of windows, one can download puttygen (available from Putty Download Page). You can use this tool to generate an openssh keypair, and use it with putty and/or filezilla. For the purpose of this tutorial. we’ll use it with filezilla.
Next, open puttygen.exe. You’ll have an option to generate a keypair, or to load a keypair. For generating a keypair, you’ll notice you have three types of keys to choose from (see figure 1.0 below). SSH-1, SSH-2 RSA or SSH-2 DSA. You will NOT want ssh version 1, as it has security issues with it’s usage and usually is NOT accepted on alot of servers. The choice between RSA and DSA is quite the debate in itself as to which is better. Once selected (or using the default) click the generate button.
Figure 1.0
puttygen main screen
Figure 1.1
Puttygen – Generation of ssh key pair
Figure 1.2
Puttygen – Completion of generated SSH key
Using the highlighted text above, you can copy and paste that into the file suggested, or click the save public key button. Typically, on a NIX server you create a hidden directory (.ssh) and paste the file contents into a file named authorized_keys. This will allow you to ssh / sftp into the server using your key, and the password of the site is irrelevant. This will get around the problem of expired keys. Typically before clicking “Save private key” you would enter a passphrase to secure your private key. However, as of FileZilla 3.5.3, this feature is not implemented. The private key should be saved to your hard drive. Every time you connect to the NIX server using your public key, it will validate against your private key. Thus, it should be in a location which is easily accessible when making a connection to the server.
KEY ISSUES:
The puttygen.exe tool generates the keypair in windows SSH format, which is different than openssh.
FileZilla