Editing the /System/Library/LaunchDaemons/com.apple.pfctl.plist file
Solution 1:
Some paths and applications in El Capitan are protected by System Integrity Protection. Even root can't modify the files. You first have to disable SIP before editing or modifying them.
- Reboot your Mac to Recovery Mode by restarting your computer and holding down CommandR until the Apple logo appears on your screen.
- Click Utilities -> Terminal.
- In the Terminal window, enter in
csrutil disable
and press Enter. - Restart your Mac
- Modify the file(s)
- Reboot your Mac to Recovery Mode by restarting your computer and holding down CommandR until the Apple logo appears on your screen.
- Click Utilities -> Terminal.
- In the Terminal window, enter in
csrutil enable
and press Enter. - Restart your Mac
Solution 2:
If you are trying to enable PF at startup, you can also try the following*.
In System Preferences / Security & Privacy / Firewall Options..., check "Enable stealth mode" and turn on Firewall.
Somehow this enables PF. You can check by running sudo pfctl -s info
.
*Tested on High Sierra and Mojave