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
질문됨 2달 전352회 조회
1개 답변
3
수락된 답변

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
전문가
답변함 2달 전
profile picture
전문가
검토됨 2달 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠