How to Close Ports in Linux
Closing unused ports helps protect your computer from attacks as it denies access to anyone attempting to connect through the port. In Linux, you can close ports for a variety of reasons and in several ways. You do not need to use advanced server methods on your personal computer. You only need to execute a few commands to first determine what ports are open, and then close ports you are not using.
Instructions
-
-
1
Open a terminal session.
-
2
Type "nmap localhost" and press Enter to see a list of open ports.
-
-
3
Type "sudo fuser -k ##/tcp" and press Enter, in Ubuntu-based systems. Replace "##" with the actual port number. In Fedora, replace "sudo" with "su -c."
-
1