Unable to connect via SSH to AWS Lightsail instance created from snapshot

2.1k Views Asked by At

I am having the exact same problem, I tried:

  1. From the UI:
    1.1. Create instance from automatic snapshot.
    1.2. Create instance from manually created snapshot.

  2. From the CLI:
    2.1. Create instance from manual snapshot also trying to disable the firewall like this answer: SSH back to AWS Lightsail after UFW enabling

  3. Creating different static IPs for the new instance.

  4. Using different SSH key/pairs (default & new) in instance creation.

  5. Recreating firewall rules from the UI.

  6. Rebooting the instance.

The result of aws lightsail get-instances is:

{
  "name": "Wordpress-Spain",
   ...
   "ports": [
     {
      "fromPort": 22,
      "toPort": 22,
      "protocol": "tcp",
       "accessFrom": "Anywhere (0.0.0.0/0)",
       "accessType": "public",
       "commonName": "",
       "accessDirection": "inbound",
       "cidrs": [
         "0.0.0.0/0"
       ],
     },
  ...  }

while nmap throws:

PORT    STATE  SERVICE
22/tcp  closed ssh
80/tcp  open   http
443/tcp open   https

According to the Lightsail UI & AWS CLI everything is ok, but I consi

An error occurred and we were unable to connect or stay connected to your instance. If this instance has just started up, try again in a minute or two. UPSTREAM_NOT_FOUND [519]

1

There are 1 best solutions below

0
On

To reproduce your situation, I did the following:

  • Launched an Amazon Linux 2 instance in Amazon Lightsail
  • Connected via SSH and created a file on the instance (for testing purposes)
  • Created a Manual Snapshot of the instance
  • Launched a new instance from the Snapshot (with all default settings)
  • Connected to the new instance via SSH (clicking on the SSH icon in the console)
  • Displayed the contents of the test file -- it matched!

The above steps were all done with default settings. It worked fine for me!

I then repeated the above using a WordPress blueprint. I was able to login to the second instance just fine.

So, it doesn't look like a Lightsail problem. It likely has to do with something that has been changed/configured on the operating system.