大网数据广告活动
服务器运维问答

How to disable UFW Ubuntu externally for AWS EC2?

· 52CE 我爱测

I am using amazon EC2. I enabled UFW in my server and without adding any other rule I logged out. Now since there was no rule specified, I am not able to login to SSH and because of it even my website is down. Can someone help me…

问题原文

原帖链接 · Cheran Prakash · CC BY-SA 4.0

I am using amazon EC2. I enabled UFW in my server and without adding any other rule I logged out. Now since there was no rule specified, I am not able to login to SSH and because of it even my website is down. Can someone help me in how to disable UFW now?

已采纳解答

原帖链接 · Cheran Prakash · CC BY-SA 4.0

thank you for the help guys,

I found a solution to the problem. I have explained them in the below points..

  • I logged into my console and stopped the current instance
  • Then went to the volumes section and detached my volume that was associated with the present instance.
  • Then launched a new instance.
  • then attached the volume of the previous instance to the new instance
  • then logged into the new instance using ssh.
  • used lsblk command to see that block devices attached to my instance. In my case there was two i.e. the one created along with the new instance and it was the root and the next was my previous instances volume which was still not mounted.
  • then I mounted the previous volume into the instance by using the command sudo mount /dev/xvdf1 /mnt -t ext4 (Here i used xvdf1 because my data was present in that)
  • then went to /mnt/etc/ufw/ufw.conf and changed enabled=yes to enabled=no
  • saved the file and logged out
  • again visited AWS console volume section and detached the previous volume and attached it to the stopped previous instance selecting exact previous instance and path as /dev/sda1
  • went to instances tab and started the old instance.
  • Now logged into the instance and it worked like a gem and all the files were intact.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-11-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。