Set Block all incoming connection via command line
I don't like to have any open port when I am connected to a public WiFi, so I usually turn on the Block all incoming settings from the Firewall preferences.
Here is a way to set/unset it via command line.
Set
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 2
Unset
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1
Bear in mind that the Preferences Panel must be closed to apply this change.
I also created a workflow to set/unset this option via Alfred.
Written by pasine
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Osx
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#