Current location - Quotes Website - Collection of slogans - What port numbers are open on the linux firewall?
What port numbers are open on the linux firewall?
When linux opens the firewall, you will find that it is no problem to log in to port 23 from this computer, but if you log in to this Linux system from another pc, you will find such an error:

Unable to open connection to host on port 23: Connection failed.

Because linux firewall closes port 23 by default, if remote login is allowed, you can close the firewall or open the firewall to open port 23, as shown below:

Effective immediately, invalid after restart.

Open: service iptables starts.

Shut down: service iptables stopped.

Take effect after restart

On: chkconfig iptables on

Close: chkconfig iptables is closed.

When the firewall is open, make the following settings and open the relevant ports.

Modify the /etc/sysconfig/iptables file and add the following:

-A RH-Firewall- 1-INPUT-m state-state NEW-m TCP-p TCP-dport 23-j ACCEPT

View firewall iptables -L

-

Netstat -nupl (UDP type port)

Netstat -ntpl (TCP type port)

You can use the lsof command to see if the port is open. View the port can be used like this, I will take port 80 as an example:

lsof -i:80

If it is displayed, it means it is open; If it is not displayed, it is not opened.