I am trying to log into SSH using the terminal:

ssh root@example.com -p54 -i ~/.ssh/ssh_key

Custom port number 45. Chmod 600 ssh_key.

I know that the SSH key works correctly because I can connect fine via Putty on windows. What could be the problem?

link|improve this question

1  
add -vv to your ssh command line and reconnect. Paste the verbose output. – Zoredache Dec 8 '11 at 19:09
feedback

1 Answer

up vote 1 down vote accepted

If you generated the key in Windows using PuTTYgen and copied the key straight over to your linux workstation, it's likely the key is in the wrong format. You should be able to use PuTTYgen to convert the key into the standard OpenSSH format.

As an aside, best practice is to have a unique keypair for each device you connect from. Just generate a new keypair on the linux workstation and add that public key to ~/.ssh/authorized_keys on example.com.

link|improve this answer
Exporting direct through putty worked perfect thanks. – John Magnolia Dec 8 '11 at 19:55
Good. You really ought to generate a unique keypair for the mac, though. – ErikA Dec 8 '11 at 19:55
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.