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.

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则