How to use SSH Public Key with PuTTY to connect to a Linux machine
- by ysap
I am trying to set a public SSH key connection from a Windows 7 machine to a Red-Hat Linux machine. The ultimate purpose is to use pscp (PuTTY's version of scp) from the command terminal w/o the need to type password repetitively.
Following PuTTY's documentation and other online sources, I used PuTTYgen to generate a key pair. I then copied the generated public key to a ~/.ssh/authorized_keys file on the Linux machine (as far as I can tell, it runs OpenSSH server).
To check the connection, I run PuTTY and set the username and private key file in the appropriate places in its GUI.
However, when trying to connect using PuTTY's SSH, the connection uses the preset username, but I get an error message of "Server refused our key" and a prompt for the password.
I then tried to copy-paste the public key text from PuTTYgen's GUI to the authorized_keys file, but it did not work either.
How should I set up a public key connection form Win 7 to Linux?
How do I use this with pscp (rather than PuTTY's ssh)?