Results 1 to 2 of 2
Hello,
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 ...
- 07-25-2011 #1Just Joined!
- Join Date
- Jul 2011
- Posts
- 2
SAMBA: Blocking access to subdirectories per IP address
Hello,
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.
Kind Regards,
Paul Preston
- 07-27-2011 #2Just Joined!
- Join Date
- Jun 2011
- Posts
- 30
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.


Reply With Quote