I entered some commands in terminal in efforts of disabling 'Harddrive' and 'Users' folder shared, did not receive much response. What exactly do the commands do?


1$ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server VirtualAdminShares -bool NO
2$ sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server VirtualHomeShares -bool NO
3$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist
4$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist


1$ "password?" (fill in password)
2$ "operation in process"

Bellow is the forum with the terminal commands. https://apple.stackexchange.com/a/376494

  • What response did you get and what did you expect? Please add that info to your question. Jun 14, 2020 at 21:36
  • 1
    What user account credentials are you using to connect? When I log in with the admin user on the serving Mac, I get everything shared. If I log in with another user, I don't.
    – benwiggy
    Jun 14, 2020 at 21:52
  • Great work Daniel asking this and linking to the old question. I’ll try to edit my post as I understand better what you are trying to do here.
    – bmike
    Jun 14, 2020 at 22:22
  • support.apple.com/guide/mac-help/… @benwiggy
    – Daniel
    Jun 15, 2020 at 0:31
  • @Daniel Sorry, I don't understand why you're showing me that Apple Support document as an answer to my question.
    – benwiggy
    Jun 15, 2020 at 7:34

1 Answer 1


I’ve never needed any command like that, so I’m not sure what they do. Why not just enable sharing with the GUI and then remove all the shares you don’t want?

That takes about 2-3 minutes tops.

I do love to teach if your goal is to learn those commands in general (and not just to get a result), so what’s happening in the first two commands is you are writing structured values (think environment variables) on windows / unix.

VirtualAdminShares is FALSE or NO
VirtualHomeShares is FALSE or NO

Then the load/unload cycles the program so that it will start up and have a chance to read the values you changed.

Just like environment variables, if the code doesn’t look for that variable or you don’t get the syntax correct - either case it does nothing.

I don’t get what your second code block indicates, so you might need to copy / paste everything in the command line so we can help debug that. I’m guessing you are not entering the password. If so, try this:

sudo date

That should ask for your password. As you type your password (the same one you would use to unlock the system preferences or log out / log in with) that gets you root permissions and should report back the date for the system time. Once you have sudo, then try the other commands within a few minutes and it shouldn’t ask for a password a second time.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .