Details
By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced.
Solution
Perform the following to implement the prescribed state:
Run the following command in Terminal to turn off AFP from the command line:
sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist
Run the following command in Terminal to turn off SMB sharing from the CLI:
sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.smb.server EnabledServices
sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist
Supportive Information
The following resource is also helpful.
This security hardening control applies to the following category of controls within NIST 800-53: Configuration Management.This control applies to the following type of system Unix.