/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. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.
Quick start
# Close port 8080
/go/deny 8080
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.
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
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).
See the full reference at /go/deny and the GoAdmio command index.
GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.
