System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1245 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
58 | System/OS | [linux] 초간단 Postfix, Covecot, SSL/TLS (SMTP) | hooni | 2017.12.11 | 9347 |
57 | System/OS | [linux] 간단한 find 명령어 설명(업데이트 해야 함) | hooni | 2013.04.23 | 9111 |
56 | System/OS | [linux] man 명령어 뽀개기.. | hooni | 2003.04.23 | 8725 |
55 | System/OS | HTTPS와 SSL 인증서 | hooni | 2014.03.11 | 7550 |
54 | System/OS | SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함) | hooni | 2014.09.11 | 5680 |
53 | System/OS | [windows] 윈도우즈 콘솔에서 정품인증 하는 방법 | hooni | 2017.05.24 | 5367 |
52 | System/OS | [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 | hooni | 2014.03.12 | 5121 |
51 | System/OS | [linux] awk 명령어 | hooni | 2014.03.11 | 4959 |
50 | System/OS | [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." | hooni | 2014.04.05 | 4859 |
49 | System/OS | [linux] resolv.con 초기화 되는 문제 | hooni | 2014.04.05 | 4626 |
48 | System/OS | [linux] CentOS Apache Httpd에 https 적용 | hooni | 2014.03.05 | 4485 |
47 | System/OS | [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) | hooni | 2017.12.11 | 4472 |