I am trying to ssh(from my Ubuntu 18.04 desktop) to a running EC2 instance

ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem ubuntu@ec2-18-194-207-247.eu-central-1.compute.amazonaws.com
ssh: connect to host ec2-18-194-207-247.eu-central-1.compute.amazonkur.com port 22: Connection timed out

The same If I try IP

ssh -i /home/miki/pizda/jk/keys/kur/kjam/python-kjam.pem ubuntu@
ssh: connect to host port 22: Connection timed out

I can ping IP

PING ( 56(84) bytes of data.
--- ping statistics ---
544 packets transmitted, 0 received, 100% packet loss, time 556011ms

Why do I have 100% packet loss? How to set security groups? enter image description here What else could cause problems?

1 Answer 1


You probably have a local firewall on the instance - iptables - that blocks your ssh traffic.

You can use AWS Systems Manager and ssm-session to access the instance and then run iptables -I INPUT -j ACCEPT and see if you can SSH to it. If it works you can then setup your firewall properly.

Hope that helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.