I am trying to open the FTP Ports on my server. I have vsftpd installed on the server already. However I am unable to reach the server on ports 20 and 21

Somehow it is allowing me to access port 21 at the moment.

I am running Ubuntu 9.10 (Karmic) I also ran: modprobe ip_conntrack modprobe ip_conntrack_ftp

The following is the iptables -L on my server

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:www
ACCEPT     tcp  --  anywhere             poseidon.valltek.com tcp dpts:ftp-data:ftp

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  poseidon.valltek.com  anywhere            tcp dpts:ftp-data:ftp

I have been using www.ping.eu/port-chk/ to check the port. Just incase it was an issue with my local machine.


migrated from stackoverflow.com Aug 9 '10 at 1:02

This question came from our site for professional and enthusiast programmers.

  • 3
    More chance at serverfault – Enriquev Aug 6 '10 at 17:27

In your output chain you're restricting destination ports, should it be source ports instead?

Also, have you checked that there is something listening on the server port?

netstat -n | grep ':2[01]'
  • the netstat -n | grep ':2[01]' did the trick. I somehow miss types the port in a config file. Thanks a million – Anonymous Aug 6 '10 at 17:51
  • Don't forget to pick an answer on here ;) – Lethargy Aug 6 '10 at 17:57

Maybe having some ambiguity with your question. If you want to use ftp service on your computer,It mainly depends on the form of transmission defined in the remote service.

  1. Port mode:

    The server connect your compute by the 20 port.using

    ~$:iptables -A INPUT -s --sport 20 -j ACCEPT

  2. Passive mode

    The server open the port greater than 1024 to establish the link with client.It is somewhat difficult,you should install models "ip_conntrack,ip_conntrack_ftp" to track the ftp packets.

    more inforemation

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.