System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1235 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
22 | System/OS | [linux] 간단한 vi편집기 사용 명령 | hooni | 2003.04.23 | 13456 |
21 | System/OS | [linux] 기본 명령어 (내공쌓기) | hooni | 2003.04.23 | 14333 |
20 | System/OS | [linux] 리눅스 활용 팁^^ | hooni | 2003.04.23 | 14629 |
19 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11359 |
18 | System/OS | [perl] 펄 환경 설정해야 할거 ㅋㅋ | hooni | 2003.04.23 | 14992 |
17 | System/OS | 컴파일러 수업 자료(교재 : 컴파일러 입문) | hooni | 2003.04.23 | 21966 |
16 | System/OS | asx미디어 정보 기록.. | hooni | 2003.04.23 | 20533 |
15 | System/OS | [linux] 쉘 스크립트에 대한 설명과 예제.. | hooni | 2003.04.23 | 13413 |
14 | System/OS | [linux] 쉘 스크립트 (Shell Script) | hooni | 2003.04.23 | 12064 |
13 | System/OS | [unix] 유닉스 csh에서 환경변수 등록 | hooni | 2003.04.23 | 11697 |
12 | System/OS | [linux] ProFTPD 타임아웃 설정 | hooni | 2003.04.23 | 12851 |
11 | System/OS | [unix] SUN Solaris 싱글모드.. ㅡ,.ㅡ; | hooni | 2003.04.23 | 11991 |