Chinaunix

标题: web服务器的iptables问题。 [打印本页]

作者: 夕水    时间: 2004-07-24 20:16
标题: web服务器的iptables问题。
默认安装fedora的apache除了80还开了一个443的https,如何关掉?我在setup里面的service没找到,如何关掉?用chkconfig也没找到。
我的iptables里面的规则是
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
RH-Firewall-1-INPUT  all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain RH-Firewall-1-INPUT (2 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere            icmp any
ACCEPT     ipv6-crypt--  anywhere             anywhere
ACCEPT     ipv6-auth--  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited
我想删掉那条关于https的,用以下命令
$ iptables -D INPUT --dport 443 -j DROP
结果老是这样
iptables v1.2.9: Unknown arg `--dport'
Try `iptables -h' or 'iptables --help' for more information.的结果,不知道该怎么办。
如果把--dport变成-dport就说Bad argument `443'
Try `iptables -h' or 'iptables --help' for more information.
大家帮我解释一下好吗?
作者: 夕水    时间: 2004-07-24 21:02
标题: web服务器的iptables问题。
自己顶啦,斑竹帮忙啊
作者: 零二年的夏天    时间: 2004-07-24 23:44
标题: web服务器的iptables问题。
可以考虑停掉iptables服务,然后自己写。
作者: yunqing    时间: 2004-07-25 03:51
标题: web服务器的iptables问题。
直接编辑/etc/sysconfig/iptables
把https那一行注释掉即可,然后重新启动iptables 服务
sudo /sbin/serverice iptables restart
作者: fushuyong    时间: 2004-07-25 07:19
标题: web服务器的iptables问题。
那是mod_ssl,在apache的配置文件中/etc/httpd/conf/httpd.conf
<IfDefine SSL>;
Listen 80
Listen 443

在这里把443#掉,当然这只是治标不治本。
至于你用iptables DROP掉443,也可以
iptables -A INPUT -s 0.0.0.0/0 -p tcp -d 172.16.10.254(web服务器的IP)--dport 443 -j DROP
作者: 夕水    时间: 2004-07-25 11:32
标题: web服务器的iptables问题。
iptables -A INPUT -s 0.0.0.0/0 -p tcp -d 172.16.10.254(web服务器的IP)--dport 443 -j DROP 这句话的意思是新建一条链对与任何地方对web服务器的IP的443端口的连接都丢掉。是吗?
可是我想删除
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
这条链为什么用 $ iptables -D INPUT --dport 443 -j DROP 这个就老出现我上面所说的错误呢?
在线等…………
作者: rdd    时间: 2004-07-25 11:40
标题: web服务器的iptables问题。
那行应该是redhat的可视化防火墙工具生成的语句吧。你插入一个楼上老兄说的链把443丢掉就可以了。http的service又不是系统的service你用chkconfig哪里有
作者: 夕水    时间: 2004-07-25 11:46
标题: web服务器的iptables问题。
那我如果想删除呢,应该怎么写那个语句?
$ iptables -D INPUT --dport 443 -j DROP 为什么错呢?
那我该怎么管理https,httpd,ftpd这样的服务啊,请大家不吝指教
作者: 夕水    时间: 2004-07-25 19:14
标题: web服务器的iptables问题。
dinginginginging,谁告诉我呀
另外我的服务器为什么要开一个21端口呢,我没开ftp 服务器,从我的防火墙看也没开,却总能看见21端口。
作者: rdd    时间: 2004-07-25 19:17
标题: web服务器的iptables问题。
那就是开了
ntsysv --level 1235
然后把vsftp的对号去掉
然后service xinetd restart
作者: 夕水    时间: 2004-07-25 19:34
标题: web服务器的iptables问题。
我是说x-scan老是说我开了21,我用netstat -an看了,没开呀
作者: platinum    时间: 2004-07-25 22:44
标题: web服务器的iptables问题。
netstat -lnp看看
作者: 夕水    时间: 2004-07-26 10:00
标题: web服务器的iptables问题。
看了  也没有啊,那怎么办?
是x-scan有问题?
我想删掉那条关于https的,用以下命令
$ iptables -D INPUT --dport 443 -j DROP
结果老是这样
iptables v1.2.9: Unknown arg `--dport'
Try `iptables -h' or 'iptables --help' for more information.的结果,不知道该怎么办。
如果把--dport变成-dport就说Bad argument `443'
Try `iptables -h' or 'iptables --help' for more information.
这个问题怎么没人回答我呀
作者: 夕水    时间: 2004-07-26 19:41
标题: web服务器的iptables问题。
又要顶啦,呵呵,高手回答一下啊
作者: platinum    时间: 2004-07-26 22:10
标题: web服务器的iptables问题。
指定端口的同时要指定协议类型
iptables -A INPUT -p tcp --dport 443 -j DROP
就应该没问题




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2