By default, ssh will try all available authentications IN ORDER (what the default order is, I'm not sure). To make sure that it doesn't try password, add the following options to your ssh command
-o 'PasswordAuthentication no'
and
-o 'PreferredAuthentications publickey'
Also, some servers and clients can be picky about permissions on the key files. Check your documentation to make sure your permissions are correct.
One other thing... It seems like it would be more secure to keep your private key at the client and put your public key on BOTH servers. Then, using authentication forwarding you can login to server A and then from server A to server B seamlessly. Remember, the strength of publickey authentication relies on being able to keep the private key private. Leaving private keys laying around on servers (especially if it's not password protected) seems like a bad idea.
Regards,
Brian Pence
Celestial Software
AbsoluteTelnet (for
ssh and
telnet on Windows )