I want to explicitly specify the folders that Samba makes visible.
For example, imagine a Samba share has folders 1, 2, 3, ..., 10. How do I tell Samba to make all folders invisible (i.e., hidden), except for folder 10?
By default it already does hide all the directories. You specify in the /etc/samba/smb.conf
file at the bottom how you want the shares to be. Here is an example:
[Share_Name]
path = "/path/to/folder/10"
directory mask = 0775
create mask = 0775
browseable = yes
writeable = yes
guest ok = yes
admin users = <username>
As long as folders 1-9 are not in folder 10, there would only be access to folder 10.
If you want to hide the folder from showing up as a share by default but still be able to access change the following line of the share of
browseable = yes
to
browseable = no
and restart Samba sudo systemctl restart smbd.service
. Then you can still access it via \\fqdn.name\Share_Name