Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't ssh after assigning an elastic ip

I configured my instance. Its up and running. I can ssh in with my key (provisioned by chef/knife) before assigning an elastic IP. For example this works (before EIP):

ssh -F .ssh/config ec2-ww-xx-yy-zz.us-west1.computer.amazonaws.com

After assigning an EIP I get a:

Permission denied (publickey)

error message as its checking my home folder for the key instead of the project directory.

I even specified the config directory an the EIP:

ssh -F .ssh/config [email protected] -v

which returns a "Connection timed out message".

When I use Elastic Fox I can see the EIP was associated correctly. Am I missing an AWS setting which denies SSH to EIPs?

like image 682
upbeat.linux Avatar asked Jun 09 '11 19:06

upbeat.linux


People also ask

Can we SSH using elastic IP?

If you want to use SSH or Remote Desktop Connection to connect to instances within your site, you need to create an Elastic IP and assign one to each instance.

Why can I not SSH into my EC2 instance?

This error occurs if you created a password for your key file, but haven't manually entered the password. To resolve this error, enter the password or use ssh-agent to load the key automatically. There are a number of reasons why you might get an SSH error, like Resource temporarily unavailable.

Can't connect to EC2 with Elastic IP?

If you can't connect to an Amazon EC2 instance or an elastic network interface that has an attached Elastic IP address, be sure that: Security group rules for inbound traffic allow connection to the port or protocol.


1 Answers

Once an EC2 instance is launched, it will assign a public and private IP address. An instance's private IP address will never change during the lifetime of that instance. However, its public dns address can change under certain circumstances.

So, after you associate an EIP to any instance, use that IP to login into your machine.

like image 188
Rakesh Sankar Avatar answered Oct 06 '22 20:10

Rakesh Sankar