Funny issue: The .ssh has to have permissions 755 otherwise when attempting to do a key auth, it will fail without logging to verbose, and just try password (making this one annoying to troubleshoot). I only caught it on a hunch while checking with a known working key auth to the solaris server. Details, details ...
- generate your ssh key pair using ssh-keygen
- ftp the public key to .ssh/authorized_keys
If the above didn't make any sense to you, then you'll probably need to read the following article (hand picked out of many available ssh tutorials as one of the easier more complete ones) http://www-106.ibm.com/developerworks/linux/library/l-keyc.html
A step by step approach to set up SSH on CygWin
Setting up SSH(based on the RSA DSA authentication protocol) on CygWin:
1)Generate the public key using the following command:
ssh-keygen -t rsa
This generates a public key and private key and the output of the statement is as follows:
Generating public/private rsa1 key pair.
Enter file in which to save the key (/home/drobbins/.ssh/identity): (hit enter)
Enter passphrase (empty for no passphrase): (enter a passphrase)
Enter same passphrase again: (enter it again)
Your identification has been saved in /home/drobbins/.ssh/identity.
Your public key has been saved in /home/drobbins/.ssh/identity.pub.
The key fingerprint is:
2)Now we need to place the generated public key into the remote server in a file named authorized_keys2. This file must be in your home directory of the remote server in subdirectory named .ssh. Hence the place where we need to transfer the public key is .ssh/authorized_keys2. The private key remains on our machine. In order to place the public key at the remote location following are commands to be executed:
a) ftp to the remote machine. For example:
b) Move the file having the public key in your home directory. For example
c) Check whether your local directory has folder named .ssh and a file named authorized_keys2 in that folder. Incase the folder is not present then create one. For example:
d) Now move the public key file into the .ssh directory.Inorder to do this telnet the remote server and move the public key file in .ssh directory. For example:
mv identity.pub .ssh/authorized_keys2
e) check using ls ?a whether .ssh exists and check whether a file named authorized_keys2 is present.