How Do You Stop a Port in Linux?
Contents

How do I close a port in Linux?

To close an open port:

  1. Log in to the server console.
  2. Execute the following command, replacing the PORT placeholder with the number of the port to be closed: Debian: sudo ufw deny PORT. CentOS: sudo firewall-cmd –zone=public –permanent –remove-port=PORT/tcp sudo firewall-cmd –reload.

How do I stop a port process?

Solutions

  1. Open a CMD window in Administrator mode by navigating to Start > Run > type cmd > right-click Command Prompt, then select Run as administrator.
  2. Use the netstat command lists all the active ports. …
  3. To kill this process (the /f is force): taskkill /pid 18264 /f.
Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article
Twitter Facebook Pinterest