I locked myself out of lightsail my ubuntu container

0

I probably did a noob mistake, I am still learning and realised I had edited the firewall in ubuntu in a way that I cannot connect to my container via ssh anymore, I cannot do anything. The only snapshot I have also has this issue, is there anyway to access it and change the firewall rules somehow or have I lost everything?

1 Risposta
1
Risposta accettata

Would it help to use the startup script described in the document "An OS-level firewall is blocking SSH port access"?
https://repost.aws/knowledge-center/lightsail-resolve-ssh-console-errors
Try setting up the following script when creating a snapshot of Lightsail and booting from the snapshot.

sudo ufw disable
sudo iptables -F
sudo mv /etc/hosts.deny /etc/hosts.deny_backup
sudo touch /etc/hosts.deny
sudo systemctl enable sshd
sudo systemctl restart sshd
profile picture
ESPERTO
con risposta un anno fa
profile picture
ESPERTO
verificato un anno fa
  • Amazing, thank you this solved it. Everything is running fine as if nothing happened.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande