How to close the port by linux
This article introduces in detail the corresponding analysis and answer to how linux closes the port, hoping to help more partners who want to solve this problem to find a more simple and easy way.
How linux shuts down the port:
1. Use the "netstat-anp | grep port" command to find out the process occupying this port, and get the process number of the process.
2. Using the "kill-9 process number" command, the process corresponding to shutting down the port can close the port.
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How does linux shut down the port
Step one, use the following command
Netstat-anp | grep port
Find out the processes that occupy this port
Step two, use the following command
Kill-9 PID
Just kill it.
Examples are as follows:
Enter the command netstat-anp | grep ssh to view the process of opening the port.
Find the process corresponding to the port you want to shut down
Enter the command for the kill-9 port number to shut down the process and port.
The answer to the question about how linux closes the port is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel for more related knowledge.