Macos – How to start SAMBA on MAC OS X from Terminal


I am trying to enable SAMBA (SMB) from terminal.

This enables AFP and File Sharing:

sudo launchctl load -F /System/Library/LaunchDaemons/

But I want enable SMB too from terminal. How can I do that? I need this for MAC OS X (10.5, 10.6, 10.7).

P.S. Same effect if you go to System Preferences->Sharing->File Sharing->SMB (Windows) need to be enabled.

Best Answer

If you run the following:

sudo launchctl load -F /System/Library/LaunchDaemons/

The service will launch, although the GUI won't update (as you force loading the service, even if disabled).

You can also remove the Disabled flag from the file and have it load regularly.

You can also run /usr/sbin/smbd directly, as root.

Related Question