Mac Procedure to Disable Firewall

I’m looking for a mac procedure to disable the firewall. I will follow-up with a request for procedure to enable the firewall. To disable, it would need the following command

sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0

hi @batboy

I have forwarded your request to concern team and requested them to get back to you .

Thank you

Hello @batboy,

To disable the firewall on a Mac, you can indeed use the command you’ve mentioned. Here’s the step-by-step procedure.

Open Terminal on your Mac.
Enter the following command.

sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0

Press Enter.
If prompted, enter your administrator password and press Enter again.
This command sets the firewall’s global state to 0, which effectively turns it off. Remember, running commands with sudo grants them administrative privileges and should be done with caution.

For re-enabling the firewall, you would use a similar command, but you would change the value from 0 to 1.

sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1

Please ensure you understand the implications of disabling your firewall, as it can make your system more vulnerable to unauthorized access.

Hi @batboy ,

Sorry for the delay response, please run this script and provide your feedback
https://scripts.itarian.com/frontend/web/topic/script-to-turn-off-or-turn-on-macos-firewall

Kind Regards,
PremJK