checkfirewall with the /go/checkfirewall Command

/go/checkfirewall makes sure the firewall has not been left blocking the ports that a GoAdmio server needs. It: Other ports, such as mail ports or the panel ports, are not checked. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/checkfirewall

Options

None. Any arguments you pass are ignored.

Examples

# Check the firewall
/go/checkfirewall

# See the rules the command looks at (Ubuntu/Debian)
ufw status

# See the rules the command looks at (AlmaLinux/Rocky/CentOS)
firewall-cmd --list-ports

# Open a port by hand with an explicit protocol
ufw allow 443/tcp

Output

The command prints nothing when all four ports are allowed. Otherwise it prints one line for each missing port:

Port 443 is not allowed in UFW.

On firewalld systems the line ends with in FIREWALLD. instead.

Message Meaning
Port <n> is not allowed in UFW. or ... in FIREWALLD. The port is not in the firewall rules. The firewall is reinstalled and the administrator is alerted.
UFW is not active. UFW is turned off. The command stops, and nothing is repaired or sent.
FIREWALLD is not active. firewalld is not running. The command stops, and nothing is repaired or sent.

Each run also adds a line to /var/log/go/checkfirewall.log.

Alert

When a port is missing, the administrator receives a message titled Firewall Checker that lists each missing port, for example:

- Port 443 is not allowed in UFW.

It is sent by email and by WhatsApp. The message lists the problems found before the firewall was reinstalled. The command does not check the ports again afterwards.

See the full reference at /go/checkfirewall 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.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *