GhostBSD Firewall: What You Need to Know to Stay Safe

When you install GhostBSD, the firewall is already enabled and running. The developers have done the heavy lifting for you so you don’t have to worry about basic security. This means you are protected as soon as you boot your computer.

How To Pause the Firewall?

Imagine this scenario: You want to connect from another computer to your GhostBSD machine using SFTP but the connection isn’t working. You check cables, credentials, and everything else yet it still refuses to connect. Before you pull your hair out, try this:

Temporarily turn off the firewall to see if it is the reason for blocking the connection.

Turn it off with:

sudo service ipfw stop

Try your connection again. If it works now, you’ve found your problem.

Once you’re done testing, turn the firewall back on again to stay protected:

sudo service ipfw start

Opening Ports When You Need To

Many of us run multiple devices at home, share files, or host small web projects. To make this work, you need to open specific ports through the firewall. For example:

  • Sharing files through SFTP means allowing port 22.
  • Running a local Apache server to test PHP or host a site means allowing ports 80 and 443.

Resetting the Firewall to Start Over

If you ever find yourself lost or unable to access your system because of firewall changes, don’t worry. There is a straightforward way to reset the firewall to its default setup and start fresh.

Just run:

sudo ipfw -f flush
sudo service ipfw restart

The first command clears all current firewall rules, and the second restarts the firewall service so it loads the default rules again.

This will get you back to a safe baseline quickly. After that, you can recreate any necessary rules following the instructions above.

Quick Tip: Running A PHP Server Easily

At times, especially for quick testing, you want a fast way to serve PHP pages without configuring a full Apache server. You can run a lightweight PHP built-in web server quickly:

php -S localhost:8000

Point your browser to http://localhost:8000 and you’re ready to test your PHP files instantly.

This tip is not about firewall rules directly but shows how sometimes, lightweight testing can avoid all the hassle of ports and firewall issues until you need to work on more than one computer.

Final Thoughts on Your Firewall

It’s completely fine to turn off the firewall for testing, but remember to turn it back on as soon as you finish. This simple habit keeps your desktop safe without blocking your ability to troubleshoot.

Check the firewall status anytime you want with:

sudo service ipfw status

You don’t have to be a security expert. GhostBSD’s firewall is designed to protect you quietly and reliably, letting you focus on using your computer without worry.