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 of being unable to connect ports in CentOS

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

How to solve the problem of unconnected ports in CentOS? I believe many inexperienced people don't know what to do about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Add port 22 to iptables

1. If you want to open port 2250808080, enter the following command

/ sbin/iptables-I INPUT-p tcp-dport 80-j ACCEPT

/ sbin/iptables-I INPUT-p tcp-dport 22-j ACCEPT

/ sbin/iptables-I INPUT-p tcp-dport 8080-j ACCEPT

two。 Modify a file

Vim / etc/rc.d/init.d/iptables

Add the above text

3. Save:

/ etc/rc.d/init.d/iptables save

4. View open ports:

/ etc/init.d/iptables status

5. Restart

5.1 / etc/init.d/iptables restart (temporarily valid)

5.2 chkconfig iptables off/on (permanent)

The above completes the addition of ports.

Now try Telnet. First, CentOS local netstat-lnpt to check whether the port is listening. If so, try it.

If it doesn't work out, step two:

2. Restart the port

Run the command: / etc/init.d/sshd restart

Many links are based on ssh links, so you need to restart them through sshd.

Then netstat-lnpt looks at port snooping.

After reading the above, have you mastered how to solve the problem of disconnected ports in CentOS? 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