CentOS安装CSF(ConfigServer Security&Firewall)防火墙,方法如下:
# wget https://download.configserver.com/csf.tgz
# tar -xzf csf.tgz
# cd csf
# sh install.sh

如果是cPanel服务器,装好CSF之后可以在WHM的Plugins里面点击ConfigServer Security&Firewall进行图形化界面管理,默认情况下,需要打开的端口

20 — FTP TCP inbound/outbound
21 — FTP TCP, UDP inbound/outbound
22 — SSH TCP inbound
25 — SMTP TCP inbound/outbound
26 — SMTP TCP inbound/outbound
37 — rdate TCP outbound
43 — whois TCP outbound
53 — DNS TCP/UDP inbound/outbound
(如果运行了DNS服务器记得开启inbound 53端口)

80 — HTTP TCP inbound/outbound
110 — POP3 TCP inbound
113 — ident TCP outbound
143 — IMAP4 TCP inbound
443 — HTTPS TCP inbound
465 — SMTP TLS/SSL TCP/UDP inbound/outbound
783 — SpamAssassin TCP/UDP inbound
873 — rsync TCP/UDP outbound
993 — IMAP4 SSL TCP inbound
995 — POP3 SSL TCP inbound
2077 — WebDAV TCP/UDP inbound/outbound
2078 — WebDAV SSL TCP/UDP inbound/outbound
2082 — cPanel TCP inbound
2083 — cPanel SSL TCP inbound
2086 — WHM TCP inbound
2087 — WHM SSL TCP inbound
2089 — cPanel license TCP outbound
2095 — Webmail TCP inbound
2096 — Webmail SSL TCP inbound
3306 — MySQL TCP (如果希望远程连接数据库服务器需要开启该端口)
6666 — Chat TCP inbound

inbound表示进入服务器的端口,outbound表示服务器出去的端口

网络任我行(www.urbansh.com)原创,转载请注明出处http://www.urbansh.com/centos-install-csf-configure-port.html