Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Jul 2011
- Sevenoaks, Kent, UK
SAMBA: Blocking access to subdirectories per IP address
I have been recently asked to block access to certain directories based on ip address.
For example: The same user:
- should have an access to directory A if he is connecting from x.x.x.x IP address, but he shouldnt have an access to directory B from that IP address
- should have an access to directory B if he is connecting from y.y.y.y IP address, but he shouldnt have an access to directory A from that IP address
Is it possible to implement that scenario in Samba?
In apache it's easy by putting few <Location X> sections with a few directives, but I couldn't find any relevent configuration example in SAMBA.
- Join Date
- Jun 2011
It's possible to allow or deny access for each shared directory.
You simply add 'hosts allow' or 'hosts deny' in /etc/samba/smb.conf for each sharename and restart the SAMBA service.
It is also possible to allow/deny access for a group of IP addresses (ex.: hosts deny = 192.168.1., this allow all IP addresses started with '192.168.1.').
See also '$> man 5 smb.conf' and search for hosts allow or hosts deny.