Why is my 'Harddrive' and 'User' folder shared when I turn on file sharing? Mac to Windows

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?

command:

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

responce:

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

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


Solution 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.