mstdmstd's avatar

I lost ssh access to ASW ec2 instance after I applied ssl

Hello, Installing laravel 8 on ASW ec2 instance(Ubuntu 20)

  1. I created Elastic IP address and applied it to my instance.

  2. I creted free domain at clousds.net, pointing it to Elastic IP address above

  3. I set ssl as I read here https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-20-04 and as result I can run https://mysite-dev.cloudns.cl/ site

  4. But I lost connection from ssh with commnd like(I copied this url in AWS console->instance->Connect button)

 ssh -i /path/StreamgeeksRebrandedKeyPair.pem  [email protected]
ssh: connect to host ec2-N1-N23-N45-N6.eu-central-1.compute.amazonaws.com port 22: Connection timed out

where -N1-N23-N45-N6 is IP of new Elastic IP address above.

Any ideas what is wrong? Any debugging/log errors ?

Thanks!

0 likes
6 replies
erikverbeek's avatar
Level 9

The issue is probably that you turned the UFW Firewall on in step 3, which now blocks your SSH port.

I found this answer on StackOverflow. Perhaps it helps.

If you are in the early stages op setting up your server and won't loose too much, you might consider just spinning up a new instance and skip step 3 in your next try.

1 like
mstdmstd's avatar

I have no access to my instance console, but In AWS console I can check Security groups and I see : https://imgur.com/a/sqe8c2Z

Reading provided branch I see Instance Settings -> Edit User Data decision.

But I got message : https://imgur.com/a/p1cim8B I am just intsalling my app aand use only mysql db and not sure what they call “ data on the ephemeral storage” ? Does it mean that Ihave to recreate all ubuntu/lamp/my app again ?

mstdmstd's avatar

Did you lose any data, sever settings?

fideloper's avatar

Hi again!

Sorry I didn't see that digital ocean article mentioned / had you setup UFW / firewall. You can skip that step if you use security groups already in AWS.

The link provided by @chaudigv should probably work, and it won't lose any configuration changes (other than what you did to setup UFW/firewall within the server).

1 like

Please or to participate in this conversation.