Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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    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  --  anywhere            tcp dpts:ftp-data:ftp

I have been using to check the port. Just incase it was an issue with my local machine.


share|improve this question

migrated from Aug 9 '10 at 1:02

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

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]'
share|improve this answer
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

share|improve this answer

You must log in to answer this question.