1

In System Preferences → Sharing → File Sharing, I only have 2 shared folders:

enter image description here

Despite this, when I go to another Mac and use the Finder's Connect to Server to mount shared folders over SMB (using an account on the server Mac and not the Guest account), it lists multiple things that are not in this list, specifically all top-level volumes (including my USB-connected Time Machine disk) and my user account.

How do I stop File Sharing from offering to share these other items over SMB?

Additional details: both computers are running macOS 10.14 (Mojave), both computers are on a local network, and the server computer has only SMB file sharing enabled, not AFP.

4
  • You do realise, I hope, that this is by design. The content of the top-level volume shares is only available after login (to the server) and according to permissions - administrators (of the server) having access to all shares.
    – Gilby
    Commented Jul 3, 2021 at 22:47
  • 1
    @Gilby Thanks for your comment. I must say it wasn't obvious (why would it be?) but even if it's by design, I think it's still a valid question to ask if there is a way to selectively unshare or hide volumes from what is offered by SMB.
    – mhucka
    Commented Jul 3, 2021 at 23:26
  • The top-level volumes are only offered if you login as an administrator and I think an administrator might well need access to those volumes. Non-administrators are only shown what they have access to. AFAIK, there is no way to completely turn off these administrator only volume shares.
    – Gilby
    Commented Jul 4, 2021 at 5:23
  • So frustrating that file sharing on MacOS, shares folders not listed under "Shared Folders" Commented Apr 2 at 6:42

1 Answer 1

4

See the original answer on stackexchange by Robert:

Turn off Volume shares (on by default)

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server VirtualAdminShares -bool NO

Turn off User shares (on by default)

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server VirtualHomeShares -bool NO

Then reboot your Mac.


Please credit the original author.

You must log in to answer this question.

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