SSH Block by UFW
Hello, I use not only the AWS firewall but also UFW on my Debian 10 instance... So, now UFW block me.
- Instance Connect don't work because I'm using Debian 10
- Since I cannot connect. I cannot install Session Manager.
- Of course the daemon of UFW start at launch...
Serial Console ask for a login, I did a user...etc But the login is not working. I'm missing something?
Help please.
Hello picarda,
I recommend attempting the following fix for this issue:
1- Stop the instance
2- If using old view of AWS Console, go to Instance Settings -> View/Change user Data
If using new AWS Console view: Right click on your Stopped instance -> Instance Settings -> Edit User Data
3- Paste the following code in the option to Modify user data as text and Save
Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0
--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
cloud_final_modules:
- [scripts-user, always]
--//
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata.txt"
#!/bin/bash
ufw disable
iptables -L
iptables -F
--//
4- Start your instance
Note: you may need to edit the public IP of the instance in the SSH command while connecting with cli to make sure you connect to the correct instance as that instance IP has likely changed
Relevant questions
SSH timeout AWS EC2
asked 3 months agoI have not connect ec2 instance by instance and ssh key
asked 3 months agoUPSTREAM_NOT_FOUND: Cannot connect to lightsail instance
asked 2 years agolightsail ssh "connecting to instance..." can't connected to my instance with ssh
asked a month agoSSH Block by UFW
Accepted Answerasked 3 months agoi cannot connect my ec2 by ssh
asked 7 months agoUnable to Connect to Instance
asked 18 days agoFix ipv6 Debian 10
asked 3 months agoHow to disable ufw ?
asked a month agoDebian 11 fails status check with instance type i3
asked a month ago