System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1414 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
34 | System/OS | CentOS 에서 Cacti 설치하기 | hooni | 2015.01.02 | 1945 |
33 | System/OS | [linux] CentOS 에 APM 설치하기 | hooni | 2015.01.02 | 1918 |
32 | System/OS | [svn] 하나의 SVN에서 멀티 저장소 (One svnserve, multiple repositories) | hooni | 2015.01.02 | 1800 |
31 | System/OS | 네트워크 용어 정리 | hooni | 2022.11.20 | 1783 |
30 | System/OS | [mac] Mac OS에서 재생되는 사운드를 녹음하는 방법 | hooni | 2016.10.03 | 1750 |
29 | System/OS | Enable Safari Hidden Debug Menu in Mac OS X | hooni | 2017.02.07 | 1741 |
28 | System/OS | [svn] SVN trunk 변경사항 되돌리기 (SVN Rollback) | hooni | 2014.11.27 | 1722 |
27 | System/OS | 무료로 HTTPS 적용하기 (Let's Encrypt) | hooni | 2017.10.28 | 1704 |
26 | System/OS | [mac] OS X 요세미티 사용자가 많이 겪는 버그와 몇몇 불편사항 | hooni | 2015.01.04 | 1690 |
25 | System/OS | OpenSSL로 ROOT CA 생성 및 SSL 인증서 발급하기 | hooni | 2017.10.28 | 1646 |
24 | System/OS | [linux] wget 명령 사용 예제 | hooni | 2020.05.26 | 1625 |
23 | System/OS | How to Install and Use wget on Mac | hooni | 2020.09.03 | 1553 |