Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have deployed a RHEL instance on EC2 with "Web Server" package fully installed.

From MAC terminal, I tried to upload a test file onto the new instance:

# scp /Applications/MAMP/htdocs/index.php

The error message I get:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
lost connection

I get a different error message when I tried to scp-ing using Elastic IP:

Address maps to, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT! Permission denied (publickey,gssapi-keyex,gssapi-with-mic). lost connection

When I tried to access the EC2 address from the browser, I get the following error:

(113) No route to host

Was hoping someone can help out. Am I missing something?

share|improve this question
EC2 servers can only have one public IP. If an elastic IP is associated with the server it dissociates the previous public IP (meaning, at least one of the above IPs points to another server). Can you SSH into the server? – cyberx86 Jul 5 '11 at 15:22
Yeap, Im able to. Never realized they were mutually exclusive. Had always been able to ssh using either, I thought. – ngzhongcai Jul 5 '11 at 15:29

I just did a couple google searches. And I have a couple things you can try:

1) It sounds like this can be caused from a vulnerability found in the keys created by SSH. You may try updating your SSH clients. sudo yum upgrade ssh.

2) Some people suggest deleting the known_hosts file from here: /.ssh/known_hosts

3) This link contains a couple ways to regenerate RSA keys. It is for ubuntu, but I'm sure it's mostly the same.

Anyways... not sure if that is very helpful or not. That is just what I found.

share|improve this answer

First of all, you should be using the -i option to provide your private key unless it's already in ~/.ssh/id_rsa. Second, check your Elastic IP assignment: if you have an Elastic IP assigned, it should replace the public IP whenever you need a public IP. You should remove any lines in ~/.ssh/known_hosts referring to either your old public IP or your elastic IP, then try again.

share|improve this answer

Your Answer


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.