Connect to your SSH server using PuTTY with the SSH protocol. When the connection succeeds you will be prompted for your user name and password to login. Once logged in, you must configure the server to accept your public key for authentication:
.ssh
directory under your home directory, and open the file authorized_keys
with your favourite editor. (You may have to create this file, if this is the first key you have put in it.) Then switch to the PuTTYgen window, select all of the text in the ‘Public key for pasting into OpenSSH authorized_keys file’ box (see section 8.2.12), and copy it to the clipboard (Ctrl+C
). Then, switch back to the PuTTY window and insert the data into the open file, making sure it ends up all on one line. Save the file.
(In very old versions of OpenSSH, SSH-2 keys had to be put in a separate file called authorized_keys2
. In all current versions, the same authorized_keys
file is used for both SSH-1 and SSH-2 keys.)
ssh.com
's product and is using SSH-2, you need to save a public key file from PuTTYgen (see section 8.2.11), and copy that into the .ssh2
directory on the server. Then you should go into that .ssh2
directory, and edit (or create) a file called authorization
. In this file you should put a line like Key mykey.pub
, with mykey.pub
replaced by the name of your key file.
You may also need to ensure that your home directory, your .ssh
directory, and any other files involved (such as authorized_keys
, authorized_keys2
or authorization
) are not group-writable or world-writable; servers will typically ignore the keys unless this is done. You can typically do this by using a command such as
chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys
Your server should now be configured to accept authentication using your private key. Now you need to configure PuTTY to attempt authentication using your private key. You can do this in any of three ways:
-i
option. See section 3.11.3.18 for details.