Jump to content

[Solved]Configure hosts allow for single share


Kaput1982

Recommended Posts

I've been scouring the forum, trying to find a way to do this but so far I have been unsuccessful.  Everything I find refers to samba-extra.conf, but as far as I can tell this only applies settings to the [global] section of smb.conf.  I specifically want to set hosts allow for one share, and not the others.  I poked around in /boot/config/shares/ but I didn't see anything in the .cfg* files that looked promising.  I found this thread but I don't know if it was ever implemented.  My only other thought is to hack together some kind of bash script using sed and add my configuration changes after boot.  I don't relish the thought of trying to figure that out.

 

If any one has any thoughts, pointers, or knows of something I've missed I'm all ears. 

Let me know if I've been unclear or can provide more information.

 

Edit - I just realized I failed to mention I'm running Unraid 6.4.1

Link to comment

I have done a search for "smb-extra".  The examples I've found of specific shares all seem to revolve around shares mounted outside the array.  In this case I created the share from the web interface.  If I remove the share I created on the web interface and manually create one using smb-extra how do the "split level" settings apply?

Link to comment
8 hours ago, Kaput1982 said:

I have done a search for "smb-extra".  The examples I've found of specific shares all seem to revolve around shares mounted outside the array.  In this case I created the share from the web interface.  If I remove the share I created on the web interface and manually create one using smb-extra how do the "split level" settings apply?

Any folder at the root of cache or array drives is a user share whether you explicitly create it from the web interface or not. If you don't make any settings to a user share it will have default settings.

 

Split level only applies to user shares as defined above.

Link to comment

Thanks for your help @trurl

 

I figured out a way to do this with a bash script, so I'll mark this as solved.  For posterity sake here is the command:

 

sed '/\[ShareName\]/a\\thosts allow = xxx.xxx.xxx.xxx' /etc/samba/smb-shares.conf  > temporary file

After that remove the smb-shares.conf file, replace it with the temporary file and restart samba. 

 

It's a bit hacky, and I haven't figured out how to get it to run after the array comes up but I'll keep plugging away at that part.

 

 

Link to comment
  • Kaput1982 changed the title to [Solved]Configure hosts allow for single share

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...