2

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?

0

1 Answer 1

1

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

2
  • Sorry, I should have been clearer: there are more directories and I need all the directories to be available (just some of them hidden). For example, if there are 100 subdirectories, and subdirectories 91-100 are visible. But the user can still enter into directories 1-90 (they are just not visible). May 31, 2022 at 19:29
  • @scaramouche Modified my answer. Hope that helps!
    – Terrance
    May 31, 2022 at 23:37

You must log in to answer this question.

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