SSH Public Key Authentication

Issue:

Windows-based SSH client, PuTTY work fine using password authentication method, but with error message: Server refused key.

Solution:

1. Use:

>ssh-keygen -t dsa -b 1024
to generate key pair;

2. Use:

puttygen.exe to convertion tool to convert the private key into putty format

Configuration:

  • SSH server: CentOS-3.5
  • SSH client: PuTTY for Windows XP

Tricks:

  • As server is using OpenSSH, the public key generated by PuTTY is not compatitble with OpenSSH, though they are both accepting SSH2 dsa keys.
  • Keys generated or imported/converted by puttygen is compatible with another SSH client WinSCP which also provide sftp feature.