Last update at :2024-03-22,Edit by888u
Today in the VPS communication group, I saw someone leaving a message asking him about the VPS host he just bought. After testing it with a tool, it was unable to connect except for port 22. Why is it? Why is port 443 inaccessible? Today, this website (www.vpsgo.com) will share the reasons and solutions for this problem.
1. Reasons why ports are blocked except port 22
When we encounter the problem that port 22 is not accessible, there are generally two reasons: there is no service listening to other ports, or the firewall needs to be opened.
We can use this online VPS port detection tool to check whether the VPS port is connected: Port detection tool
1. There is no service listening port
The prerequisite for the port to be open is that you have a service monitoring/occupying this port. For a newly created VPS, if its default SSH port is 22, then only port 22 has an SSH service monitoring, so only port 22 is open. When you try to connect to other ports via telnet, it will naturally time out.
We can use the above online tool to check whether the corresponding port can be connected, as shown below, a new VPS, because the SSH service listens to port 22 by default, so port 22 is open:
But we changed the port to 23, because there is no service listening to port 23, so it naturally fails:
Another example is the domain name "www.vpsgo.com". Because port 443 has an https service listening, port 443 is also open:
2. The firewall is not open
Firewall settings include two aspects:
2. Solution to port failure
If you do not have a service listening port and the port is blocked, then just set up a service to listen on that port. For example, if you build a website, it will listen to ports 443 and 80 by default. If you build MySQL, it will listen to 3306 by default. port.
If your port is blocked due to system-level firewall settings, the easiest way is to change the system. For example, Ubuntu generally does not have firewall problems, or you can also refer to the following tutorial to set up the firewall:
- "CentOS7 modifies the SSH port, you need to set up the firewall Firewalld and SELinux to release the new port"
If you set up a firewall at the merchant's web page level, you can go to the web page and add rules to allow the port. Related tutorials:
- "Tencent Cloud Host Turns Off the Firewall and Adds Firewall Rule Settings Tutorial" (similar to Alibaba Cloud and Amazon Cloud)
- "Introduction to Vultr Firewall Group: Add Custom Firewall Rules to Vultr" (Vultr has no firewall rules by default)
In addition, if your VPS port is blocked and cannot be accessed, then just restart the service and change the listening port.
Recommended site searches: cancellation registration, Hong Kong IP proxy, Hong Kong cloud host, foreign server, national dynamic IP, 100m free space, cheap domain name registration, free proxy IP address, asp host space, free US host,
发表评论