Prerequisites: First of all, you must know that the port does not exist independently, it is attached to the process. When a process is started, its corresponding port is opened, and when the process is closed, the port is closed. The next time if a process is turned on again, the corresponding port will be turned on again. Instead of purely understanding it is to turn off a port, but you can disable a port.
1. You can see which ports are open by "~$ netstat -anp". (Note: Adding the parameter '-n' will turn the application into port display, ie the address in digital format, such as: nfs->2049, ftp->21, so you can open two terminals, one by one corresponding to the program The corresponding port number) 2. Then you can view the program that applies the port ($PORT refers to the corresponding port number) through "~$ lsof -i:$PORT". Or you can look at the file /etc/services, from which you can find out which service the port corresponds to. (Note: Some ports can't be found through netstat. The more reliable method is "~$ sudo nmap -sT -O localhost") 3. To close a port, you can: 1) Ban the port with the iptables tool. Off, such as: "~$ sudo iptables -A INPUT -p tcp --dport $PORT -j DROP" "~$ sudo iptables -A OUTPUT -p tcp --dport $PORT -j DROP" 2) or off When the corresponding application is dropped, the port is naturally closed, such as: "~$ kill -9 PID" (PID: process number) such as: by "~$ netstat -anp | Grep ssh" has the display: tcp 0
Computer Store News Microsoft released Windows8 RTM for PC OEMs and manufacturer partners on August
diskless boot everyone should have heard of it, and now many Internet cafes and enterprises have use
A flash drive is one of the most useful tools a person can have. With it, you can back up critical d
Computer store news: Do you remember that Steam is ready to host? Now there is new news: this hardwa
Glusterfs cluster distributed file system off the brick processing
Apache Reverse Proxy on the Linux Firewall
Vinux experience operating system for the blind
Linux Process Fundamentals Summary The
Linux system PPPoE broadband connection setting method
Linux software installation and uninstallation Basic tutorial
Git Common Commands Quick Reference Table
mogileFS Distributed Storage - Installation Notes
Linux to the desktop still takes
How to solve the slow start of the win10 system computer?
Three ways to open disk management under Win10 system
How to find recently modified files in Linux
Good software in win8 helps you to have fun in the big year
Teach you three ways to easily uninstall Win 7 SP1 Beta
What are the common problems with win10? Win10 common problems and solutions summary
The problem that the software cannot be installed under Vista, how to solve it?
Win10 RS1 preview version 11103 system ISO English version mirror download
Win10 Preview 10158: Mysterious web app features, Wi-Fi is everywhere