Activities

November 2009
M T W T F S S
« Oct   Dec »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Customise the ftp ports and open it on firewall

Here I am using VSFTP server. When this problem occurs when I open the only port 20,21 on firewall and ftp connected. But I can view the files listed there. This is probabily issue with the ftp data communication issue.

VSFTP config file location – /etc/vsftp.conf

1. Add firewall exception for dataport ( here I uses 50000:60000 ranges of port for data communication)

# opening non standard port for ftp data transferring

/sbin/iptables  -A INPUT   -p tcp  --dport 50000:60000  -j ACCEPT
/sbin/iptables  -A INPUT   -p udp  --dport 50000:60000  -j ACCEPT

2, Edit

vi /etc/vsftpd.conf

and comment
E

g : #connect_from_port_20=YES

3, Change the listen port to higher port

listen_port=201

4, Add the following line to the end of the config file.

pasv_enabled=yes
pasv_min_port=50600
pasv_max_port=60000

This line force the ftp server to use the listed for passive connection.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>