﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>运维部落 &#187; iptables</title>
	<atom:link href="http://help.vps12.com/tag/iptables/feed" rel="self" type="application/rss+xml" />
	<link>https://help.vps12.com</link>
	<description>分享服务器运维及实践解决方案</description>
	<lastBuildDate>Sat, 25 Jan 2025 07:14:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CentOS下安装fail2ban防暴力破解工具（转）</title>
		<link>https://help.vps12.com/1164.html</link>
		<comments>https://help.vps12.com/1164.html#comments</comments>
		<pubDate>Sun, 15 Jun 2014 02:53:42 +0000</pubDate>
		<dc:creator>vps12.com</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[解决方案]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[vps]]></category>
		<category><![CDATA[vps12.com]]></category>
		<category><![CDATA[vsftp]]></category>
		<category><![CDATA[vsftpd]]></category>
		<category><![CDATA[台湾vps]]></category>

		<guid isPermaLink="false">http://blog.vps12.com/?p=1164</guid>
		<description><![CDATA[CentOS下安装fail2ban防暴力破解工具： 前言：首先说说为什么笔者会想到写这篇博客，源于昨天下午，突然收到Nagios的报警邮件，说邮件服务器的进程数超过阀值。于是赶紧登录上去查看。 这里说下分析的过程： 1.既然说进程数超过阀值，肯定先查看进程：ps -ef； 2.如果不能即时看到问题，那就动态显示：top，看看究竟是哪个程序占用这么多进程； 3.最后确定了应该是courier-imap，但还不知道是什么原因导致； 4.查看ip连接，确认是否是其存在问题：netstat -ant，发现有大量的110连接； 5.既然是收信服务，那就赶紧追踪查看邮件日志：tail -f /var/log/maillog； 6.发现问题：日志里有大量的登录错误信息，发现是同一ip，并在用不同的用户名密码来暴力破解 7.稍等一会，确定目标IP后，将其ip的包丢弃：iptables -I INPUT -s 176.61.143.41 -j DROP #此ip为真实攻击ip，所以在此曝光 8.稍等一会，再次查看进程，进程数有明显下降，故障解决。 介于这种安全隐患的存在，我们以后可以利用fail2ban来实现防暴力破解，防止恶意攻击。 下面就来说说fail2ban具体是什么。 简介： fail2ban可以监视你的系统日志，然后匹配日志的错误信息（正则式匹配）执行相应的屏蔽动作（一般情况下是调用防火墙屏蔽），如:当有人在试探你的SSH、SMTP、FTP密码，只要达到你预设的次数，fail2ban就会调用防火墙屏蔽这个IP，而且可以发送e-mail通知系统管理员，是一款很实用、很强大的软件！ 功能和特性： 1、支持大量服务。如sshd,apache,qmail,proftpd,sasl等等 2、支持多种动作。如iptables,tcp-wrapper,shorewall(iptables第三方工具),mail notifications(邮件通知)等等。 3、在logpath选项中支持通配符 4、需要Gamin支持(注：Gamin是用于监视文件和目录是否更改的服务工具) 5、需要安装python,iptables,tcp-wrapper,shorewall,Gamin。如果想要发邮件，那必需安装postfix或sendmail 核心原理： 其实fail2ban就是用来监控，具体是调用iptables来实现动作！ 好了，那下面来说说具体怎么安装、部署吧。 一、首先是服务安装 首先配置yum源，这里采用的是yum直接装（也可源码安装） vim /etc/yum.repos.d/CentOS-Base.repo 在最后新增： [atrpms] name=Red Hat Enterprise Linux $releasever &#8211; $basearch &#8211; ATrpms baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms gpgcheck=1 enabled=1 [...]]]></description>
		<wfw:commentRss>https://help.vps12.com/1164.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables:restorecon: command not found无法保存策略解决</title>
		<link>https://help.vps12.com/370.html</link>
		<comments>https://help.vps12.com/370.html#comments</comments>
		<pubDate>Fri, 29 Jun 2012 04:11:57 +0000</pubDate>
		<dc:creator>vps12.com</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[vps12.com]]></category>
		<category><![CDATA[台湾vps]]></category>
		<category><![CDATA[日本vps]]></category>
		<category><![CDATA[美国vps]]></category>
		<category><![CDATA[香港vps]]></category>

		<guid isPermaLink="false">http://blog.vps12.com/?p=370</guid>
		<description><![CDATA[为客户安装了linux运行一些iptables设置时。运行保存策略时不生效。 ?View Code CODE1 2 3 service iptables save &#160; iptables: Saving firewall rules to /etc/sysconfig/iptables: /etc/init.d/iptables: line 268: restorecon: command not found 解决办法： ?View Code CODE1 yum -y install policycoreutils 然后运行命令保存iptables策略: ?View Code CODE1 2 3 service iptables save &#160; iptables: Saving firewall rules to /etc/sysconfig/iptables: [ OK ] 问题解决！ 总结：由于有些简化linux系统进行了优化所以有些包没有自定义安装了。所以一般这类问题都是少rpm支持包。一般增加一下，就可以解决问题！]]></description>
		<wfw:commentRss>https://help.vps12.com/370.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iptables使用中文说明</title>
		<link>https://help.vps12.com/333.html</link>
		<comments>https://help.vps12.com/333.html#comments</comments>
		<pubDate>Sun, 17 Jun 2012 17:41:52 +0000</pubDate>
		<dc:creator>vps12.com</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[vps12.com]]></category>
		<category><![CDATA[防火墙]]></category>

		<guid isPermaLink="false">http://blog.vps12.com/?p=333</guid>
		<description><![CDATA[总览 用iptables -ADC 来指定链的规则，-A添加 -D删除 -C 修改 iptables &#8211; [RI] chain rule num rule-specification[option] 用iptables &#8211; RI 通过规则的顺序指定 iptables -D chain rule num[option] 删除指定规则 iptables -[LFZ] [chain][option] 用iptables -LFZ 链名 [选项] iptables -[NX] chain 用 -NX 指定链 iptables -P chain target[options] 指定链的默认目标 iptables -E old-chain-name new-chain-name -E 旧的链名 新的链名 用新的链名取代旧的链名 说明 Iptalbes 是用来设置、维护和检查Linux内核的IP包过滤规则的。 可以定义不同的表，每个表都包含几个内部的链，也能包含用户定义的链。每个链都是一个规则列表，对对应的包进行匹配：每条规则指定应当如何处理与之相匹配的包。这被称作&#8217;target&#8217;（目标），也可以跳向同一个表内的用户定义的链。 TARGETS [...]]]></description>
		<wfw:commentRss>https://help.vps12.com/333.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
