SSH into server randomly stopped

0

Hello,

Suddenly I was unable to SSH/SFTP into my lightsail server. However, when I saw that I was able to connect using the Lightsail web SSH - I saw that under /home/ubuntu ... the .ssh folder was missing. So I copied over the contents of the .ssh folder another server that uses the same ssh key and after doing that, I lost complete access - including from the web ssh. Here is the error I get:

Your instance encountered an error and has closed the connection. Try again or contact customer support.

UPSTREAM_ERROR [515]

This scenario had occurred about 2 months ago and I had done the same thing - copied over the authorised_keys and known_hosts from another server that uses the same ssh key and it had worked.

How this ssh folder got deleted, or how did I loose access suddenly is a mystery.

Additionally: I have daily snapshots enabled on this server, so when I create a new instance from the latest 3 snapshots, for each of those, while I don't get the UPSTREAM ERROR, and the browser RDP does open, it doesn't load up a linux terminal. Instead it shows a blank black screen with the cursor on position 0.

Please let me know if this can be helped.

asked a year ago287 views
2 Answers
2

This knowledge centre article addresses what might be causing your error message, as well as some possible resolutions https://repost.aws/knowledge-center/lightsail-resolve-ssh-console-errors

The specific behaviour you mention, where you copy the public key across from another server but then you can't authenticate using it, assuming there's not a mismatch with the keys it sounds like it could be permissions related. The ~/.ssh directory should have 700 permissions, is that definitely set?

The other error you mention (blank screen with cursor in the top left corner when you try to spin up a new instance from a snapshot) isn't anything to do with the presence or absence of SSH keys, it points to an issue with the snapshot, which may point to an issue with the underlying lightsail instance. Can you go back further than three days to find a good snapshot?

profile picture
EXPERT
Steve_M
answered a year ago
  • Thanks a lot for your response.

    The ~/.ssh directory should have 700 permissions, is that definitely set?

    Yes after I copied over the authorization_keys and known_hosts, I assigned 700 via chmod to the /home/ubuntu/.ssh folder as well. Like I said, I had done the exact same solution about 2 months ago and that worked.

    it points to an issue with the snapshot, which may point to an issue with the underlying lightsail instance

    Exactly my thoughts as well. But unfortunately, there is nothing that can be done about this. Stopping and starting (which should assign a new "instance") also didn't work. The server in question is a low sized instance created maybe 3-4 years ago. So what can be done about this now?

    Can you go back further than three days to find a good snapshot? We have only 7 days of snapshots. All of them face the same issue. I had a snapshot from Feb and that shows the same as well. After waiting about 10 minutes, I get this error:

    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]

0

I'd also recommend going through this article (https://repost.aws/knowledge-center/lightsail-resolve-ssh-console-errors) to see if any of the approaches can help with your issue.

If none of them works, can you try follow this tutorial to create a new custom SSH key pair to use with the instance?

  1. https://repost.aws/knowledge-center/lightsail-troubleshoot-lost-ssh-keypair
  2. https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-managing-ssh-keys
AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions