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
Author by
Peyman
Updated on September 18, 2022Comments
-
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 withnmap
and I saw ports didn't open.What can I do? I need to open these ports.
-
Admin almost 12 yearsWhat firewall are you using?
-
Admin almost 12 yearsWhat firewall software are you using?
-
Admin almost 12 yearsSome ISPs block ports 20 and 21, did you make sure your ISP allows them?
-
-
Peyman almost 12 yearsThank you but dosn't work. terminal sey to me:: -A: command not found
-
j0N45 almost 12 yearsInstead of -A please try it with -I
-
Peyman almost 12 yearsDosn'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 about 11 yearsMake sure your ISP allows you to use those ports, there are ISPs that will block those ports automatically.