How to enable the adaptive firewall on OS X Server

The adaptive firewall helps prevent entry to your server by unauthorized users over network connections. 

OS X Server uses an adaptive firewall that dynamically generates a firewall rule if a user or an IP address generates 10 consecutive failed login attempts. If you have OS X Server installed on OS X Mavericks or later, use these Terminal commands as an admin user to enable the adaptive firewall.

sudo pfctl -f /etc/pf.conf
sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serverctl enable service=com.apple.afctl
sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/afctl -c
sudo /Applications/Server.app/Contents/ServerRoot/usr/libexec/afctl -f
Last Modified: