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
質問済み 3ヶ月前359ビュー
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
エキスパート
回答済み 3ヶ月前
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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ