Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
2  
add -vv to your ssh command line and reconnect. Paste the verbose output. –  Zoredache Dec 8 '11 at 19:09

1 Answer 1

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.

share|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. –  EEAA Dec 8 '11 at 19:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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