Current location - Quotes Website - Collection of slogans - How to disable ports in linux system?
How to disable ports in linux system?
1, the port generally corresponds to the corresponding network service program. To disable a port, you can first check the service corresponding to the port. Then shut down the service.

netstat -antup

2. You can also disable it through iptables. Taking port 8080 as an example, execute the following command:

Iptables- an input port tcp-dport 8080 -j DROP

Iptables -A input port tcp-sport 8080 -j DROP

Iptables- an input port udp-dport 8080 -j DROP

Iptables -A input p udp-sport 8080 -j DROP