How to open a port in Ubuntu?

Question:

I'm new to ubuntu, so I can't figure out why the port is not opening and how to do it anyway. Tell me please!

I tried to open the port in iptables, but as I understand it, iptables is used to manage the ufw firewall, and when I enter the sudo ufw status I get the answer:

sudo: ufw: command not found

How to open the port in this case? Google advised me only iptables.

Just in case, I will give the output of the netstat -an | grep LISTEN

tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTENtcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTENtcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTENtcp        0      0 5.231.61.235:53         0.0.0.0:*               LISTENtcp        0      0 127.0.0.2:53            0.0.0.0:*               LISTENtcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTENtcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTENtcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTENtcp6       0      0 ::1:953                 :::*                    LISTENtcp6       0      0 :::53                   :::*                    LISTENtcp6       0      0 :::22                   :::*                    LISTENtcp6       0      0 ::1:631                 :::*                    LISTENunix  2      [ ACC ]     STREAM     LISTENING     3215411995 /var/run/cups/cups.sockunix  2      [ ACC ]     STREAM     LISTENING     3215409707 /var/run/avahi-daemon/socketunix  2      [ ACC ]     STREAM     LISTENING     3215403381 @/com/ubuntu/upstartunix  2      [ ACC ]     STREAM     LISTENING     3215406175 /var/run/dbus/system_bus_socketunix  2      [ ACC ]     STREAM     LISTENING     3215553140 /var/run/sendmail/mta/smcontrolunix  2      [ ACC ]     STREAM     LISTENING     3215421071 /var/run/acpid.socketunix  2      [ ACC ]     SEQPACKET  LISTENING     3215405745 /run/udev/controlunix  2      [ ACC ]     STREAM     LISTENING     3215427067 /var/run/saslauthd/mux

That is, it seems like the 53rd port is open … How else to open ports?

Answer:

Your listing is not open ports, but the output of who is listening to which ports.

If you want to open port 53 over tcp, for example, using the iptables utility:

iptables -I INPUT -p tcp -m tcp --dport 53 -j ACCEPT
Scroll to Top