반응형
방화벽 특정포트 활성화 후 포트가 안열리기에 ufw를 활성화하는 삽질을 해서 멀쩡히 잘되던 ssh가 안되는 문제 발생
ec2 서버 중지 후
작업 > 인스턴스 설정 > 사용자 데이터 편집 으로 들어가서 아래와 같이 ufw를 비활성화 해준다.
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
--//
https://stackoverflow.com/questions/41929267/locked-myself-out-of-ssh-with-ufw-in-ec2-aws
Locked myself out of SSH with UFW in EC2 AWS
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
stackoverflow.com
반응형
'IT & 개발 > etc' 카테고리의 다른 글
생성형 AI 챗GPT 활용법: 코드 작성 및 디버깅 (3) | 2024.10.07 |
---|---|
[python] 파이썬 기초 - 웹 스크래퍼 간단 예제 (0) | 2023.11.03 |
[GIT] vscode git auto login(git credential) 설정 (0) | 2023.06.19 |
[AI 자동투자 봇] 키움증권 KOA 스튜디오 api 접속 오류 (0) | 2022.09.26 |
[Html] Video Tag start_time, end_time (0) | 2022.09.20 |