Disable Samba Client on OS X

10.6 Snow Leopard

The Samba client on OS X is what enables Apple computers to access folders shared on a Windows network. Documation uses ExtremeZ-IP from GroupLogic to manage connections to Windows servers. As a means to reduce confusion for Mac users over whch share to connect to we disable OS X's ability to connect to common Windows file shares by turning off the smb client (Samba).

You will need to use the command line to disable this service. Before you start:

  • You should now how to open and use the terminal on OS X
  • How to use the sudo command to gain elevated priviledges.
  • You will need the Admin user name and password

This method of turning off the smb client was found in Apple Documentation
Mac OS X Security Configuration For Mac OS X Version 10.6 Snow Leopard (near page 264.)

Keep in mind that the examples here may use path or name information specific to Documation, and to the setting in use at the time this document was created. (Oct. 2012)

Step by Step

  1. Log on the OS X and the local administrator. As of this writing (10-1-2012) the local admin account on the Mac computers is tech.
  2. Open the terminal application, and make the window large enough to use comfortably
  3. The following command will copy the Preferances file to the admin user's Documents folder (in this example the admin username is 'tech'). You want to save this file in case you want to turn the service back on.
    sudo cp /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist /Users/tech/Documents/com.apple.smb.server.xml
  4. The next command removes the smb service from the “EnabledServices” list.
    sudo defaults delete /Library/Preferences/SystemConfiguration/com.apple.smb.server EnabledServices
  5. The following six commands turn off the service dæmons related to the smb client service. Execute them one at a time. (Note: this documents may wrap the text, these commands should each be one line.)
    sudo launchctl unload -w /System/Library/LaunchDaemons/nmbd.plist
    sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist
    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smb.server.preferences.plist
    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smb.sharepoints.plist
    sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbfs_load_kext.plist
    sudo launchctl unload -w /System/Library/LaunchDaemons/org.samba.winbindd.plist
  6. Restart the computer.

Re-Enable the Samba service

Re-enabling the service uses nearly the same commands.

  1. Replace the plist file using the following command:
    sudo cp /Users/tech/Documents/com.apple.smb.server.xml /Library/Preferences/SystemConfiguration/com.apple.smb.server.plist
  2. The next command replaces the smb service from the “EnabledServices” list.
    sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server EnabledServices
  3. The next six commands turn on the service dæmons related to the smb client service.
    sudo launchctl load -F /System/Library/LaunchDaemons/nmbd.plist
    sudo launchctl load -F /System/Library/LaunchDaemons/smbd.plist
    sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.smb.server.preferences.plist
    sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.smb.sharepoints.plist
    sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.smbfs_load_kext.plist
    sudo launchctl load -F /System/Library/LaunchDaemons/org.samba.winbindd.plist
  4. Restart the computer.
Last modified:: 2016/03/19 16:03