Linux open firewall port and view, open the relevant port number

Linux opens the firewall port and view, open the relevant port number When Linux opens the firewall, you will find that it is no problem to log in to port 23 from the local machine, but if you log in to the Linux system from another PC, you will find a prompt like this The error: Cannot open the connection to the host, on port 23: The connection fails because the Linux firewall closes port 23 by default, if remote login is allowed, you can turn off the firewall, or open the firewall to open port 23, as follows: Immediately effective, Disable after restart: service iptables start Disable: service iptables stop Enable after restart: chkconfig iptables on Disable: chkconfig iptables off When the firewall is enabled, make the following settings, open the relevant ports, modify the /etc/sysconfig/iptables file, and add the following Contents: -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 check whether a port is open. Check that the port can be used in this way. I will take port 80 as an example: lsof -i:80 If there is a display, it means that it has been opened. If there is no display, it means that it is not open.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326921961&siteId=291194637