Can you limit a specific samba share to certain IPs?
I know in smb.conf you can limit all samba shares to certain IPs with "hosts allow", but is there a way to do it for only a specific share too?
|
Yes, as far as I know hosts allow is valid on a per share basis.
|
Just depends on where you put that 'hosts allow'
if you put it under global, then it will only allow those hosts 'globally' if you put it under a share config, then it will only restrict ip's to that share |
Oh ok, so it's valid under both, but if you do it at the share level, you must do it for all then.
So say i have three shares, but I only do an allow hosts under two of them, does that mean the one without allow hosts is then wide open, or closed off to everyone due to the lack of allow hosts? |
So, searching for an example, I actually found an explanation for what you want: https://bbs.archlinux.org/viewtopic.php?id=108500
And here is the gist of it (other things removed for brevity, this is not a working example) Code:
#smb.conf file |
awesome, thanks sz!
Now if I can just figure out how to limit a specific share so it only shows/allows a certain total disk space, I'd be all set. Trying to tweak some existing servers but really not sure what's possible and what isn't yet. Really appreciate the help on this hosts allow thing. |
No problemo.
Simple answer: Put each share on its own partition. Size the partition accordingly. Advanced reminder: Make it LVM, so you can easily expand your disk when you run out of space. |
I was afraid that was going to be the only answer. Was hoping there was a way to do it via samba config, since this is an existing server I'm hoping I don't need to reload.
|
Well the only other way I know how is by using quotas. Now, Samba doesn't directly know about these quotas, instead it is configured and handled in the user space by quotad. Its involved, and possibly complicated based on your linux level. But here is the first guide i found:
http://www.linuxhomenetworking.com/w...s#.Uw9wA9xb11s Im not sure how up to date that is, so you should certainly look up the documentation regarding quotas for your specific distro! TLDR,.. you can enable quotas on a disk and set up each samba mount to use a specific user that has a disk quota. |
That might be a clever way to do it, force the mount to use a user that has a quote. I'll have to dig into it, but that's a pretty clever idea. thanks again!
|
All times are GMT -5. The time now is 08:51 AM. |