1

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 root@ec2-46-137-229-91.ap-southeast-1.compute.amazonaws.com:/var/www/html

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 122.248.232.146 maps to ec2-122-248-232-146.ap-southeast-1.compute.amazonaws.com, 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?

ngzhongcai
  • 113
  • 5
  • 2
    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 05 '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 05 '11 at 15:29

2 Answers2

0

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.

Mr. Monkey
  • 225
  • 1
  • 4
  • 11
0

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.

Michael Lowman
  • 3,604
  • 20
  • 36