5

why is SSH not working?

I keep getting..

ssh: connect to host ec2-11-11-11-11.compute-1.amazonaws.com port 22: Operation timed out

when trying to connect to my amazon EC2 server, at first i thought it was some sort of firewall but i have no firewall and i can SSH in to my MediaTemple server.

the chmod of my pem is 600. and this is how im trying to ssh..

ssh -i ~/.ssh/ServerKey.pem [email protected]

i have a AMI ID: ami-508c7839 so i seen on a video the user should be ubuntu.

i hope someone can see an error somewhere because i dont have a clue. if it helps to know im on a mac.

thanks in advance

4 Answers 4

2

Run your ssh command in verbose mode to see where exactly it's timing out in.

ssh -i ~/.ssh/ServerKey.pem -v [email protected]

Also, I would advice you to specify the absolute path to your ssh key instead of using the ~ tilde sign. (It will save you a headache if you want to auto connect to your EC2 server from a script/cron).

-Tony

Sign up to request clarification or add additional context in comments.

3 Comments

ok, thanks... this is what i got back MacBook-Pro:~ aaranmcguire$ ssh -i ~/.ssh/ServerKey.pem -v [email protected] OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009 debug1: Reading configuration data /etc/ssh_config debug1: Connecting to ec2-11-11-11-11.compute-1.amazonaws.com [50.19.33.24] port 22. debug1: connect to address 50.19.33.24 port 22: Operation timed out ssh: connect to host ec2-11-11-11-11.compute-1.amazonaws.com port 22: Operation timed out
It sounds like its a firewall issue. You may need to check your Inbound firewall policies on the security group that our instance is using. Make sure the policy "Port 22 (SSH) source 0.0.0.0/0" is set.
did that and restarted the instance... still the same
2

Go to Security Group, and make sure the policy "Port 22 (SSH) source 0.0.0.0/0" is set.

Comments

1

Make sure that you have hit "Apply Rule Changes" in Security Groups tab.

Comments

0

I do not think it is an problem of ssh. I suggest you check the network reahcability.

Try to ssh the ip address directly. Try to debug the dns.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.