deny
Close a TCP port by removing its allow rule from the server's firewall
- Command:
/go/deny - Category: Firewall
- Required option: The port number (first argument)
- Output: Usually nothing, or messages from the firewall
- Last updated: 2026-11-20
On this page: Overview · Quick start · Syntax · Arguments · Output · Examples · Troubleshooting · Details · See also
Overview
/go/deny closes an incoming TCP port. It is the opposite of allow.
It does not add a "deny" rule. It removes the rule that allows the port, so the port is closed as long as the firewall blocks everything that is not explicitly allowed. It uses firewalld on AlmaLinux, Rocky, CentOS, Red Hat, and Fedora, and ufw on Debian and Ubuntu.
[!WARNING] Closing the port that your SSH session, the GoAdmio panel, or your websites use can lock you out or take services offline. Run
checkfirewallafterward to confirm that the required ports are still open.
Quick start
# Close port 8080
/go/deny 8080
Syntax
/go/deny <port>
Run the command as root. It has no options.
Arguments
| Argument | Required | Notes |
|---|---|---|
<port> |
Yes | A whole number from 1 to 65535, written without leading zeros. Only TCP is affected. |
Anything else prints Invalid PORT and exits with status 1.
Output
On success the command is usually silent, because firewalld success messages are hidden.
| Message | Meaning |
|---|---|
Invalid PORT |
The port is missing, not a number, or outside 1 to 65535. Exit status 1. |
Warning: NOT_ENABLED: <port>:tcp |
firewalld only. The port was not open. Harmless. |
Rule deleted and Rule deleted (v6) |
ufw only. The IPv4 and IPv6 rules were removed. |
Could not delete non-existent rule |
ufw only. There was no matching rule. Harmless. |
The wording of the firewall messages depends on the firewall version. The command returns the status of the last firewall command, so it can exit with 0 even when nothing was removed. Check the firewall itself to be sure (see Examples).
Examples
# Close remote MySQL access
/go/deny 3306
# Close a port, then check what is still open (firewalld)
/go/deny 8080
sudo firewall-cmd --zone=public --list-all
# Close a port, then check what is still open (ufw)
/go/deny 8080
sudo ufw status
# Confirm the required GoAdmio ports are still open
/go/checkfirewall
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Invalid PORT |
The port is empty, contains letters, or is out of range. | Pass a number from 1 to 65535. |
| The port is still open after running it | Another rule also allows it, for example a firewalld service such as http, a rule in a different zone, or a ufw application profile. |
List the rules and remove the other one by hand. |
| Nothing happens on my server | The operating system is not one the command supports. | Close the port with your firewall's own tool. |
| I can no longer log in over SSH or open the panel | The port that was closed is the SSH or panel port. | Reopen it from the provider's console with allow. |
Could not delete non-existent rule |
The port was not open, or the rule was already removed. | No action needed. |
command not found for firewall-cmd or ufw |
The firewall isn't installed. | Install it with firewall. |
| An open connection still works | Closing a port blocks new connections. Existing ones usually continue until they end. | Restart the service on that port, or wait. |
Details
What it removes
| Operating system | Firewall | Rules removed |
|---|---|---|
| AlmaLinux, Rocky, CentOS, Red Hat, Fedora | firewalld, public zone, permanent |
<port>/tcp, then a reload. |
| Debian, Ubuntu | ufw |
<port>/tcp (IPv4 and IPv6), then a reload. |
Special ports
| Port | Extra rule removed |
|---|---|
22 |
The ssh service (firewalld) or the ssh rule (ufw). |
3306 |
The mysql service (firewalld) or the mysql rule (ufw). |
Port numbers with leading zeros, such as 022, skip these extra steps.
Limits
- Only TCP rules are removed. UDP rules stay.
- On
firewalld, only thepubliczone is changed, and only the permanent configuration, which is then reloaded. - A port opened through a named service, such as
httporhttpsonfirewalld, is not closed by its number. Onlysshandmysqlare handled by name. - Any other operating system is ignored: the command prints nothing and changes nothing.
Side effects
- Every call is logged to
/var/log/go/deny.log. - The firewall is reloaded at the end. The reload's output is hidden, so a reload failure is not shown.
See also
| Command | Description |
|---|---|
allow |
Open a port in your server's firewall |
checkfirewall |
Verify that important required ports are open on your server |
firewall |
Install a firewall on a GoAdmio server |
block |
Block an IP address on a GoAdmio server |
unblock |
Unblock an IP address on a GoAdmio server |
port |
Change the default SSH port (22) to another port |
smtp |
Manage the SMTP port: block, unblock, and change it |