I’m trying to enable Account Sharing from terminal. I can’t figure out how to do that.
This will be used from inside an application I’m currently programming. The application creates a hidden user, then should enable SMB sharing for this user. Later, I need to connect to this share via another server using SMB.
I need the same effect as going to System Preferences → Sharing → File Sharing → enable any account for sharing using SMB.

What I already have:
- I know how to create a hidden user
- I already know how to create individual shared folders, but not account sharing.
What I’ve already tried:
- I already tried to scan the system for last modified files to find some information in Samba config files, but it didn’t help.
What I don’t need:
- I can’t do this with SSH. The folders need to be shared via SMB.
THIS WORKS FOR OS X 10.5, 10.6, 10.7
First type this in terminal
SomeUsercan also be hidden, it doesn’t matter. This gives the same effect like enabling that checkbox as shown in the picture above.After that:
This gives the same effect, as enabling it from System Preferences, when it asks for a password. It’s the same like filling in that password.
If you want to disable SMB on that account (
SomeUsercan be hidden again):P.S. In Mac OS X Lion, they changed their implementation for SMB (SMBX). But be aware that it still uses the same Share Points mechanism for creating a share, and Directory Service is responsible for it. Also it still works the same way for enabling SMB on account!