Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 installed vsftpd in my Linux Server 12.04. Unfortunately my firewall closed port 20 and 21. So I used the commands found here and other commands to open my ports. But I tested with nmap and I saw ports didn't open.

What can I do? I need to open these ports.

share|improve this question
What firewall are you using? – saji89 Aug 8 '12 at 10:59
What firewall software are you using? – Mitch Aug 8 '12 at 11:00
My firewall is iptables – Peyman Aug 8 '12 at 11:06
Try ufw allow in ftp – Cumulus007 Aug 8 '12 at 12:18
Some ISPs block ports 20 and 21, did you make sure your ISP allows them? – Thomas Ward Aug 8 '12 at 16:54

Sometimes a port will need to be forwarded from the router (take a look at port forwarding), or perhaps port 21 is already pointing to something else on the network?

share|improve this answer

On the website there was these 2 lines

iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -p tcp --dport 20 -j ACCEPT

After that you may need to restore your iptables rules with:

share|improve this answer
Thank you but dosn't work. terminal sey to me:: -A: command not found – Peyman Aug 8 '12 at 12:14
Instead of -A please try it with -I – j0N45 Aug 8 '12 at 12:16
Dosn't work. but I can solved my problem, I wrote 'iptables -F' in terminal and 'Listen 21' in /etc/apache2/ports.conf and then restart apache. Thank you – Peyman Aug 9 '12 at 9:24
Make sure your ISP allows you to use those ports, there are ISPs that will block those ports automatically. – Thomas Ward Mar 2 '13 at 20:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.