How to open port 21?

33,804

Solution 1

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?

Solution 2

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:

iptables-restore < LOCATION_OF_IPTABLES_RULES_FILE
Share:
33,804
Peyman
Author by

Peyman

Updated on September 18, 2022

Comments

  • Peyman
    Peyman over 1 year

    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.

    • Admin
      Admin almost 12 years
      What firewall are you using?
    • Admin
      Admin almost 12 years
      What firewall software are you using?
    • Admin
      Admin almost 12 years
      Some ISPs block ports 20 and 21, did you make sure your ISP allows them?
  • Peyman
    Peyman almost 12 years
    Thank you but dosn't work. terminal sey to me:: -A: command not found
  • j0N45
    j0N45 almost 12 years
    Instead of -A please try it with -I
  • Peyman
    Peyman almost 12 years
    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
  • Thomas Ward
    Thomas Ward about 11 years
    Make sure your ISP allows you to use those ports, there are ISPs that will block those ports automatically.