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
To share files securely via SFTP, you need to open port 22.
How to Open Port 22 (SFTP)
To allow incoming connections on port 22, run this command:
sudo ipfw add 100 allow tcp from any to any 22 in
100is the rule number (you can choose any number, but pick one that’s easy to remember).allowmeans the firewall will let this traffic through.tcpis the network protocol used by SFTP.from any to anymeans connections from anywhere to your computer.22is the port number to open.inmeans incoming connections.
You can check your current firewall rules anytime with:
sudo ipfw list
How to Close (Remove) a Port
If you no longer need to allow connections on port 22, remove the rule using its number:
sudo ipfw delete 100
This deletes the rule with number 100, effectively closing port 22 again.
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.
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.