Re: FTP and Firewall
- From: "Kalyan Manchikanti" <kalyan.manchikanti@xxxxxxxxx>
- Date: 20 Feb 2007 19:03:01 -0800
On Feb 20, 6:08 pm, Stephane M <Steph...@xxxxx> wrote:
StephaneM a écrit :
Kalyan Manchikanti wrote:
On Feb 20, 1:43 am, Stephane M <Steph...@xxxxx> wrote:
Hi,
I wish to use my Firewall
I am using CentOS v 4.4 and I did use the Firewall setup available on
the GYI
[ Enable the Firewall and Accept FTP, WWW ]
1) the web works fine !!1
2) The FTP site doesn't work
I edit my /etc/sysconfig/iptables
- A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j
ACCEPT
- Is there something wrong with that ?
3) All this settings are configure via their port.
Now, suppose that I wish to disable (or Enable) an application like
SAMBA
- How can I do that ?
Thanks very much for your help
Stephane
Unless you are very familiar with how iptables work, editing /etc/
sysconfig/iptables is not usually the best option. Instead you can use
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p udp --dport 21 -j ACCEPT
Also, after making any changes to your firewall rules, do a
service iptables save --> saves the rules ( puts a copy of the old
rules in /etc/sysconfig/iptables.save)
and make sure firewall is on in the appropriare levels ( chkconfig --
list iptables)
As to your question regarding samba. Samba allows access control
through it's configuration file. Check man smb.conf for various
options you can use within it's conf file to restrict users and/ or
hosts.
hth,
Kalyan
Sorry but it doesn't work
I browsed the web and I found some other way.
Here is what I have.... but it doesn't work....
I have no idea what is wrong
HTTP works fine..
vSFTPD doesn't work out :-(
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j
ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j
ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -m tcp -p
tcp --dport 20 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -m tcp -p
tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j
ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j
ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j
ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
Is there any problem with CentOS v 4.4 (vSFTPD and IPtables ?)
I just created a basic Firewall with FedoraCore 5
FTP and HTTP works fine.
I did copy the iptables files (from Fedora -> CentOS v 4.4 => FTP still
doesn't work !!!!!! ????
Stephane
Not to be redundant, but did you check the configuration of the vsftpd
itself ? I'd do the following in the order
1. Check /etc/vsftpd/vsftpd.conf for any errors or syntax issues.
2. Check if vsftpd is turned on in the proper run levels. ( chkconfig
--list vsftpd)
3. Check if tcp wrappers are enabled for vsftpd by any chance ( /etc/
hosts.allow and /etc/hosts.deny)
4. Do you see anything in /var/log/messages when you try to connect?
5. As a last resort, flush your firewall rules using iptables -F( do a
service iptables save before) and try connecting. Your old rules will
be saved in /etc/sysconfig/iptables.save
hth,
Kalyan
.
- Follow-Ups:
- Re: FTP and Firewall
- From: Stephane M
- Re: FTP and Firewall
- From: Stephane M
- Re: FTP and Firewall
- References:
- FTP and Firewall
- From: Stephane M
- Re: FTP and Firewall
- From: Kalyan Manchikanti
- Re: FTP and Firewall
- From: StephaneM
- Re: FTP and Firewall
- From: Stephane M
- FTP and Firewall
- Prev by Date: Re: FTP and Firewall
- Next by Date: Re: FTP and Firewall
- Previous by thread: Re: FTP and Firewall
- Next by thread: Re: FTP and Firewall
- Index(es):
Relevant Pages
|
|