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 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace un año
profile picture
EXPERTO
revisado hace un año
  • Amazing, thank you this solved it. Everything is running fine as if nothing happened.

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