Problem trying to open port on a linux server

Asked

Viewed 1,379 times

-1

Hello, I’m having a problem trying to open a port on my Ubuntu linux VPS. I’m looking to create an ftp server, but I can’t open port 21. The support staff said that all the doors are already open by default, but it seems that the 21 is not open.

I’ve tried several ways. This is one of the commands I’ve been around to change the firewall configuration

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

I have tried using "ufw" and also tried using "csf"

But without success. I check nmap and other online tools, but they always show that door 21 is closed.

1 answer

2

After validating that 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"
  • It didn’t work. I applied this command and the door is still closed.

  • @Srmax can post his vsftpd conf?

  • Make sure the service is listening at the door you want netstat -lnap | grep <serviço>

  • Thanks guys. I solved the problem, I didn’t have the server running.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.