Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that the port of linux is blocked?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

How to solve the problem that the port of linux is blocked? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

All linux systems have network firewall settings. If the firewall is turned off, as long as a certain port on the linux has a certain service, then this port can be connected to telnet. The premise that a certain port of telnet can be connected is that the port is in service, and the firewall allows access to the port.

Let's talk about how to solve the problem of blocked ports.

The required port settings can pass through the firewall:

The way to set a port to pass through the firewall is as follows:

Vi / etc/sysconfig/iptables

Go to the editing page and add the following configuration at the specified location

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 8080-j ACCEPT

This sentence should be put after-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 22-j ACCEPT

After modification, save and exit, restart the network card service.

Service iptables restart

View port opening information

Service iptables status

Generally speaking, the server can see the open information even if it is opened successfully.

Determine whether a port is in service

Netstat-anp | grep "port number to be viewed", such as netstat-anp | grep "9001"

If 9001 is set up in / etc/sysconfig/iptables to pass through the firewall and the service is started again, then other computers in this network segment will be able to telnet port 9001 of the machine. You can also check whether telnet localhost 9001 can be connected by telnet on this computer.

If you purchased the server, you also need to set the port release in the security group.

After reading the above, have you mastered the solution to the problem that the port of linux is blocked? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report