[Samba] Making shares invisible to unauthorized users

Mac mac at nibsc.ac.uk
Tue Apr 27 11:18:03 GMT 2004

>Is there a simple way to set up Samba so that users ONLY see the shares that 
>belong to them? 
>I'm not talking about the user's HOME directory. But lets say I have 60 
>shares in my smb.conf file. To make it less confusing for users when they access 
>the Samba server from Windows, I want the users to ONLY see the shares that 
>belong to them. 
>So, I want to set up each share so that it is only readable and writeable by 
>a single user. And so that only that user can see the share. What are the key 
>settings to achieve this kind of "visibility and access control"? 
>I have figured out most of my Samba issues on my own, but I have a deadline 
>today to get this issue resolved and I would appreciate hearing from someone 
>who knows the solution. 

Haven't had a chnace to test this out, but it sounds like
you might want to look at the 'include' option in smb.conf.

Simply put each user's share in a separate file named

	smb.USERNAME.conf  (with USERNAME changed for each user)

and then remove the share from the main smb.conf,

Then put a line like:-

	include  =  smb.%U.conf

and that will (I think) give you different shares listed
per user.

More info on the smb.conf(5) man page.

I know this works for %L  (meaning that users see a different
list of shares depending on which NetBIOS name they use to connect
to the server.

          Assistant Systems Adminstrator @nibsc.ac.uk
                        dmccann at nibsc.ac.uk
   Work: +44 1707 641565          Everything else: +44 7956 237670 (anytime)

More information about the samba mailing list