Skip to content
Shellbay

Networking & Firewall · about 1 min · 2 steps

Close a port

Stops connections from the internet reaching a port. Shellbay refuses to close the SSH port.

Runs on

  • Debian / Ubuntu: supported
  • RHEL / Fedora: supported
  • Alpine: supported

What it changes on your server

  • Removes the allow rules for the port from ufw or firewalld, whichever is on. In firewalld, also removes services (such as http) that open only that port.
  • If the firewall lets everything in by default, adds a rule that blocks the port. Rules that allow the port only from specific addresses are kept.

What Shellbay asks you

  1. Which port should be closed?

    Programs on this server can still use the port; only connections from outside are blocked. The SSH port can't be closed here.

    Port
    A port number from 1 to 65535. Default: 8080
    Protocol
    One of: tcp, udp, both. Default: tcp

    Example: 8080

Steps

  1. Remove the allow rules
  2. Check the port is closed

Shellbay checks the server before the first step, and stops at the first step that fails.

When it's done

  • Port ‹port› is closed in the server's firewall. Run Open a port to undo it.