{"id":122445,"date":"2018-10-07T08:41:19","date_gmt":"2018-10-07T00:41:19","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=122445"},"modified":"2018-09-30T09:42:10","modified_gmt":"2018-09-30T01:42:10","slug":"iptables-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/iptables-linux.html","title":{"rendered":"\u5927\u795e\u6559\u4f60\u7528iptables\u9650\u5236sftp\u7aef\u53e3\u8fde\u63a5\u6570"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | \u4e4b\u524d\u5728\u516c\u53f8\u670d\u52a1\u5668\u4e0a\u90e8\u7f72\u4e86sftp\uff0c\u7528\u4e8e\u4e0a\u4f20\u4e1a\u52a1\u7cfb\u7edf\u7684\u9644\u4ef6\u3002\u540e\u6765\u7531\u4e8e\u7a0b\u5e8f\u8fde\u63a5\u95ee\u9898\uff0c\u4f7f\u7684sftp\u8fde\u63a5\u6570\u8fc7\u591a\uff08\u6700\u591a\u65f6\u9ad8\u8fbe400\u591a\u4e2asftp\u8fde\u63a5\u6570\uff09\uff0c\u56e0\u4e3a\u6025\u9700\u8981\u5bf9sftp\u7684\u8fde\u63a5\u6570\u505a\u4e25\u683c\u9650\u5236\u3002\u64cd\u4f5c\u8bb0\u5f55\u5982\u4e0b\uff1a<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n \u542f\u52a8sftp\u672c\u673a\u7684iptables\u9632\u706b\u5899\u529f\u80fd\uff0c\u9650\u5236\u6bcf\u4e2aip\u8fde\u63a522\u7aef\u53e3\uff08sftp\u8fde\u63a5\u7aef\u53e3\u5373\u662fssh\u7aef\u53e3\uff09\u6700\u5927\u4e3a50\u4e2a\uff0c\u5f53\u8d85\u8fc750\u540e\u7684\u8fde\u63a5\u6570\u7684\u6d41\u91cf\u5c31\u4f1a\u88abDROP\u6389\uff01<\/p>\n \u540c\u65f6iptables\u9700\u8981\u5f00\u653e50000-65535\u8303\u56f4\u7684\u7aef\u53e3\u7684\u8bbf\u95ee\uff08linux\u7cfb\u7edf\u6700\u5927\u7684\u7aef\u53e3\u4e3a65535\uff09<\/p>\n [root@localhost ~]# cat \/etc\/sysconfig\/iptables\r\n# Firewall configuration written by system-config-firewall\r\n# Manual customization of this file is not recommended.\r\n*filter\r\n:INPUT ACCEPT [0:0]\r\n:FORWARD ACCEPT [0:0]\r\n:OUTPUT ACCEPT [0:0]\r\n-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT\r\n-A INPUT -p icmp -j ACCEPT\r\n-A INPUT -i lo -j ACCEPT\r\n#-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT\r\n-A INPUT -p tcp --syn --dport 22 -m connlimit --connlimit-above 50 --connlimit-mask 0 -j DROP\r\n-A INPUT -m state --state NEW -m tcp -p tcp --dport 50000:65535 -j ACCEPT\r\n#-A INPUT -j REJECT --reject-with icmp-host-prohibited \/\/\u6ce8\u610f\u8fd9\u4e24\u884c\u9700\u8981\u6ce8\u91ca\u6389\uff01\u5426\u5219\u8bbe\u7f6e\u7684\u7b56\u7565\u65e0\u6548\uff01\r\n#-A FORWARD -j REJECT --reject-with icmp-host-prohibited\r\nCOMMIT<\/pre>\n |