Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to disable the port number of a CVM

Shulou Source: shulou.com Published: 2022-06-02 01:00:28 09月15日 Update

Today, I will talk to you about how to shut down the port number of the CVM, which may not be well understood by many people. In order to make you understand better, the editor summarized the following contents. I hope you can get something from this article.

If you need to know which ports are open in the current CVM system, and the associated processes and users of these ports, you can query them through the netstat command. You can stop port occupancy by following these steps:

1. Find the process occupied by the port

two。 Use the netstat-antp | grep 9000 command to view (take port 9000 as an example):

3. You can see which PID process occupies this port.

4. Then stop the corresponding process.

Commonly used netstat commands

Netstat-n-p | grep SYN_REC | sort-u lists all connected IP addresses.

Netstat-n-p | grep SYN_REC | awk'{print $5}'| awk-F:'{print $1} 'lists the IP addresses of all sending SYN_REC connection nodes.

Netstat-ntu | awk'{print $5}'| cut-d:-F1 | sort | uniq-c | sort-n calculates the number of connections from each host to the local machine.

Netstat-plan | grep: 80 | awk {'print $5'} | cut-d:-f 1 | sort | uniq-c | sort-nk 1 lists all IP addresses connected to port 80 of the machine and their number of connections. Port 80 is generally used to handle HTTP web page requests.

After reading the above, do you have any further understanding of how to shut down the port number of the CVM? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Tags: Port process server service content command address slogan can be passed native host commonly used more step user knowledge article system web page node Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Apple Shulou Technology Microsoft Shulou Information