Walker News

How To Use Putty-generated RSA Key To Login Linux OpenSSH Server?

In order for Windows users to remotely login Linux servers via SSH protocol, I suggest the Putty freeware (a SSH client for Windows that is also supporting legacy, insecure telnet and rlogin protocol).

For the sake of better security, most system administrators enforce SSH authentication over Public-key cryptography based on RSA algorithm.

(Sounds complicated and high-tech? No worry. You don’t have to know all these scary terms to make this trick works – engineer is applying what the scientists have found).

So, How to use Putty-based RSA public-key with OpenSSH server?

The public-key generated by Puttygen is not compatible with the one generated by OpenSSH.

However, you can manually modify the Putty-based public key before appending it to authorized_keys file:

1) Open Puttygen (Putty Key Generator), click Generate button and move the mouse cursor randomly within the key section/frame to create the key with default settings (e.g. SSH-2 RSA of 1024 bits).

2) When the key generation completes, create a strong passphrase in the text box provided.

3) Then, click save Public Key and Save Private Key button, one after another, to save the pair of key to local hard disk.

4) Transfer the Puttygen-created public key to Linux server (in my test case, it’s RHEL 5.2).

Let’s say this public key is only meant for Walker user account, save that public key in Walker’s $HOME/.ssh directory.

5) Open the Putty public key with Vi editor (any text editor of your choice):
  • Delete the lines initial with four dash and “Comment”.
  • Join the remain lines into one, single line.
  • Initial that single line with ssh-rsa keyword (a space at the end).

Not get it? Take a look at my “silent” screencast:



Custom Search

2014  •  Privacy Policy