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
preguntada hace 2 meses352 visualizaciones
1 Respuesta
3
Respuesta aceptada

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
EXPERTO
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses
  • 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.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas