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

I have an AWS linux instance running that I'm trying to SSH into. When I type in the manual command (using mac, terminal):

ssh -i ~/.ssh/PEM.pem root@IPADDRESS

it works fine, but when I try to give that an alias in the config file in my SSH colder, such as

Host hostname
User root
IdentityFile "file"
HostName IPADDRESS

I get the error:

Permission denied (publickey).

I have other AWS aliases in my config file with the exact same setup that work fine, any ideas? Thanks.

Update I figured out what was going on here, I had a trailing whitespace at the end of my .pem location. Man is that stuff finicky.

share|improve this question

migrated from stackoverflow.com Mar 24 '11 at 11:38

This question came from our site for professional and enthusiast programmers.

    
have you looked at hosts.allow and hosts.deny? I'd also check out /var/log/secure and /var/log/messages on the AWS linux instance and see what they have to say. –  George Mar 24 '11 at 11:09
    
Try ssh -v, it will dump a lot of information, maybe some will be useful. (-vv for even more info. :) –  sarnold Mar 24 '11 at 11:10
    
@Caleb, good catch. Add it as an answer and accept it, so others might be spared going nuts. :) –  sarnold Mar 24 '11 at 11:19
    
Also, make sure there is a 600 permission on whole .ssh and content of it –  Ency Mar 24 '11 at 11:40

1 Answer 1

I figured out what was going on here, I had a trailing whitespace at the end of my .pem location. Man is that stuff finicky.

share|improve this answer

Your Answer

 
discard

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