System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1225 댓글 0
# 내 서버 설정 (firewall.sh)
#!/bin/bash
# iptables automation script
iptables -F
# open 22port first for ssh
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
# configure for basic policy
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# accept to localhost
iptables -A INPUT -i lo -j ACCEPT
# accept to established and related
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# open 80 port for apache
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# save the configuration
/sbin/service iptables save
# print out
iptables -L -v
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
190 | System/OS | [unix] 유닉스 csh에서 환경변수 등록 | hooni | 2003.04.23 | 11694 |
189 | System/OS | [linux] 쉘 스크립트 (Shell Script) | hooni | 2003.04.23 | 12064 |
188 | System/OS | [linux] 쉘 스크립트에 대한 설명과 예제.. | hooni | 2003.04.23 | 13413 |
187 | System/OS | asx미디어 정보 기록.. | hooni | 2003.04.23 | 20533 |
186 | System/OS | 컴파일러 수업 자료(교재 : 컴파일러 입문) | hooni | 2003.04.23 | 21964 |
185 | System/OS | [perl] 펄 환경 설정해야 할거 ㅋㅋ | hooni | 2003.04.23 | 14992 |
184 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11356 |
183 | System/OS | [linux] 리눅스 활용 팁^^ | hooni | 2003.04.23 | 14629 |
182 | System/OS | [linux] 기본 명령어 (내공쌓기) | hooni | 2003.04.23 | 14333 |
181 | System/OS | [linux] 간단한 vi편집기 사용 명령 | hooni | 2003.04.23 | 13456 |
180 | System/OS | [linux] 프로그램 설치방법 (내공쌓기) | hooni | 2003.04.23 | 13433 |
179 | System/OS | [linux] 계정관리하기(내공쌓기) | hooni | 2003.04.23 | 13156 |