问题
I've enabled the UFW service without allowing SSH access before then logging off.
I am now unable to ssh back to the instance.
The steps I have already taken:
- Made a snapshot and create a new instance from it
回答1:
The general point: try to execute a command (firewall disabling) while creating a new instance. I was able to do it with the usage of AWS CLI:
aws lightsail create-instances-from-snapshot --region eu-central-1 --instance-snapshot-name TEST_SSH_FIX-1591429003 --instance-names TEST_SSH_FIX_2 --availability-zone eu-central-1a --user-data 'sudo service ufw stop' --bundle-id nano_2_0
It`s work.
回答2:
You could create a snapshot and use it to create another new instance, and add sudo service ufw stop
to the launch script.
来源:https://stackoverflow.com/questions/62181754/ssh-back-to-aws-lightsail-after-ufw-enabling