Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Enable and disable the firewall via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Enable and disable the firewall via AppleScript
Authored by: brett_x on Feb 20, '09 12:06:49PM

Wow.. that's a workaround. Here's a one-liner to enable or disable it in a shell script (or just in terminal as admin)

defaults write /Library/Preferences/com.apple.alf globalstate 0
that will disable it

defaults write /Library/Preferences/com.apple.alf globalstate 1
will enable it and set it to "Set access for specific services..."

defaults write /Library/Preferences/com.apple.alf globalstate 2
will enable it and set it to "Allow only essential services"

Of course
defaults read /Library/Preferences/com.apple.alf globalstate
will return a result of 0, 1 or 2 which correlates to the above settings.



[ Reply to This | # ]
10.5: Enable and disable the firewall via AppleScript
Authored by: pukupi on Apr 29, '09 06:48:18PM
This doesn't work: it changes the Firewall UI state but doesn't change the firewall state. You can confirm this for yourself but running these commands and testing open ports via Shields Up!:

https://www.grc.com/x/ne.dll?bh0bkyd2

[ Reply to This | # ]