I have an EC2 Instance with Ubuntu.
I used sudo ufw enable
and after only allow the mongodb port
sudo ufw allow 27017
When the ssh connection broke, I can´t reconnect
I have an EC2 Instance with Ubuntu.
I used sudo ufw enable
and after only allow the mongodb port
sudo ufw allow 27017
When the ssh connection broke, I can´t reconnect
I have the same problem and found out that this steps works:
1- Stop your instance
2- Go to `Instance Settings -> View/Change user Data
3- Paste this
4- Start your instance
Hope it works for you
Other approaches didn't work for me. My EC2 instance is based on Bitnami image. Attaching volume to another instance didn't work because of marketplace locks.
So instead stop the problem instance and paste this script in instanceSettings > view-change user data.
This approach do not require detaching the volume so it's more straight forward as compared to other ones.
Must stop instance before pasting this, after this start your instance and you should be able to ssh.
I know this is an old question but I fixed mine by adding a command in View/Change User Data using
bootcmd
I first stopped my instance
Then I added this in User Data
#Note: My instance is Ubuntu
Somehow Mahesh's answer didn't work for me, if you happen to be in my shoes, try this.
sudo lsblk
to display attached volumes and confirm the name of the problem volume. It usually begins with/dev/xvdf
. Mine is/dev/xvdf1
Mount problem volume.
Open
ufw
configuration fileENABLED=yes
toENABLED=no
Display content of ufw conf file using the command below and ensure that
ENABLED=yes
has been changed toENABLED=no
Unmount volume
Detach problem volume from recovery instance and re-attach it to the original instance as /dev/sda1.
Source: here
Now find ENABLED=yes and change it to ENABLED=no.
Be sure to unmount the volume first:
Hola !! you are good go.