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

This enables AFP and File Sharing

sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

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 Preferecnes->Sharing->File Sharing->SMB (Windows) need to be enabled.

Thanks.!

link|improve this question

75% accept rate
I'm quite sure you could somehow record an Automator action workflow thingie for this and run it. EDIT: Ignore that, you want to do it from the terminal. – Tristan Seifert Oct 23 '11 at 19:48
feedback

migrated from stackoverflow.com Oct 23 '11 at 20:22

This question came from our site for professional and enthusiast programmers.

2 Answers

If you run the following:

sudo launchctl load -F /System/Library/LaunchDaemons/com.apple.smbd.plist

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.

link|improve this answer
Thanks. But first option won't work on Snow Leopard.Couldn't stat("/System/Library/LaunchDaemons/com.appl.smbd.plist"): No such file or directory. – User1234 Oct 24 '11 at 6:07
@User1234 You mistyped the file name: appl – Daniel Beck Oct 24 '11 at 6:13
sorry. here it is Couldn't stat("/System/Library/LaunchDaemons/com.apple.smbd.plist"): But it works for Lion, I guess on Snow Leopard it is ddifferent. It doesn't update UI , but it is avalaible? – User1234 Oct 24 '11 at 6:17
I guess on MAC OS X Snow Leopard it is com.apple.smb.server.preferences.plist – User1234 Oct 24 '11 at 6:18
It's not working, it's displaying empty , that nothing is shared, when I try to connect from windows. – User1234 Oct 24 '11 at 7:24
show 3 more comments
feedback

On Snow Leopard it's /System/Library/LaunchDaemons/smbd.plist

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.