--- In lucknow-lug@ yahoogroups. com, "kvbiju22" <kvbiju22@.. .> wrote:
>
> --- In lucknow-lug@ yahoogroups. com, "pcy1988" <pcy1988@> wrote:
> >
> > in RHCE examination if a question is asked that "configure a ftp
server
> > for your local system and rest of the network should not be able
to
> > access your ftp repository".
> > let assume that i configured the server correctly, but problem is
> > related with denying access.
> > should we simply use the file "/etc/hosts. deny" or IPTABLES.
> > which one will be better.
> > is it necessary to apply netfilter rule to all server related
question.
> >
>
> I think the case is similar when we configure telnet, where we can
> deny the access by editing the file /etc/xinetd. d/telnet. Open the
> file in any editor and add a line
> only_from = 172.25.0.0 where 172.25.0.0 is your local network.
> Restart the servie xinetd . This would solve the problem in
telnet.It
> should work for ftp too, I beleive..
> Hope Anooj will have a better solution
> Try it once
>
The straight forward method is using tcp-wrappers i.e. /etc/hots.deny
files, as devilisback said.
we can also configure the same using xinetd a more comprehensive
approach.
f.e. to integrate vsftpd with xinetd we need to take following steps.
1). Create a file /etc/xinetd. d/vsfpt with the following entries
# default: off
# description: The vsftpd FTP server serves FTP connections. It uses \
# normal, unencrypted usernames and passwords for authentication.
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/vsftpd
nice = 10
#for your particular requirement to disallow all in the network
only_from = 127.0.0.1
}
2). Edit your /etc/vsftpd/ vsftpd.conf file and comment out line
with "listen=YES"
3). Restart or reload the xinetd service.
/sbin/service xinetd reload
Now test your configuration with
netstat -a |grep ftp
also
To avoid port conflict at boot time turn off the vsftpd service
chkconfig vsftpd off
As of now our vsftpd is integrated with xinetd make sure that xinetd
starts automatically.
chkconfig xinetd on
Anuj Singh