How to open ports on Linux operating systems?
In this article we will show you how to open ports on Linux operating systems.
To get the list of all open ports type one of the following commands:
lsof -i -n –P
The procedure of opening ports in the Linux operating systems is associated with firewall iptables and is relatively simple.
In order to open an incoming TCP port, type the following command:
iptables -I INPUT -p tcp –dport PORTNUMBER -j ACCEPT
In order to open an incoming UDP port, type the following command:
iptables -I INPUT -p udp –dport PORTNUMBER -j ACCEPT
Finally save iptables for the changes to take effect.
service iptables save