Locked out from my Server Due to Misconfiguration in SSH

0

Hi, I am using Ubuntu 20.04 Lightsail and accessing it through SSH using the SSH Key file I made a blunder while setting up google MFA for ssh. I haven't taken a snapshot and proceeded to set up the configuration. I forgot to disable common-auth which led me into a infinite password loop while trying to login through ssh. Any way to access the server or the data in the server?

When I try accessing it through the browser client, it says CLIENT_UNAUTHORIZED [769], so I lost all my ways to access the server.

Snapshot is using the existing configuration, so it is unable to access the new instance, too

(Note: SFTP, SCP both prompt the verification code and password just like ssh while trying to access the instance, and only god knows what password that is)

Kasier
asked 2 months ago337 views
1 Answer
3
Accepted Answer

Hello.

If your Lightsail instance doesn't contain important data, it may be easier to recreate it.

If it contains important data and you want to restore it, you may be able to create a snapshot from the Lightsail root volume by following the steps in the document below, create a volume from that snapshot, and then attach it to a normal Lightsail instance to restore the data.
https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-create-an-instance-root-volume-snapshot.html

If you attach a volume to a healthy instance, modify the SSH settings, create another snapshot from that volume, and create an instance, you may be able to start it.
https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-create-instance-from-snapshot.html

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
  • Thanks a lot and a lot. I am out of words. I thought I was not going to recover it. Even Chatgpt 4 failed, lol.

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