Problem trying to open port on a linux server [closed]

-1

Hello, I'm having a problem trying to open a port on my Linux VPS Ubuntu. I'm trying to create an ftp server, but I can not open port 21. The support staff said all ports are already open by default, but it looks like 21 is not open.

I've tried it in several ways. This is one of the commands I ran to change the firewall configuration

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

I've tried using "ufw" and also tried using "csf"

But to no avail. I check in nmap and other online tools, but they always show that port 21 is closed.

    
asked by anonymous 22.01.2018 / 13:00

1 answer

2

After validating if your port is actually standing, use the following commands to release INPUT and OUTPUT .

iptables -A INPUT  -p tcp -m tcp --dport 21 -m conntrack --ctstate ESTABLISHED,NEW -j ACCEPT -m comment --comment "Liberar INPUT porta 21"
iptables -A OUTPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT -m comment --comment "Liberar OUTPUT porta 21"
    
22.01.2018 / 13:07