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 Resposta
1
Resposta aceita

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
ESPECIALISTA
respondido há um ano
profile picture
ESPECIALISTA
avaliado há um ano
  • Amazing, thank you this solved it. Everything is running fine as if nothing happened.

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas