LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   "Hosts allow" in Samba (https://www.linuxquestions.org/questions/linux-networking-3/hosts-allow-in-samba-834522/)

Mr. Alex 09-26-2010 01:30 AM

"Hosts allow" in Samba
 
If I set:
Code:

hosts allow = 192.168.0.5 192.168.0.8
then only PCs with IP addresses 192.168.0.5 and 192.168.0.8 will be able to enter shared dir? And noone else? And if there's no "hosts allow" in config of Samba, Samba doesn't filter IPs? Is it correct?

Mr. Alex 09-26-2010 01:46 AM

And is it good for security to add
hosts deny = all
before
hosts allow ...
?

toothandnail 09-26-2010 09:17 AM

Yes to both. You should also add 'localhost' to the hosts.allow section, otherwise you will get some strange error messages.

Paul.

Mr. Alex 09-26-2010 10:33 AM

Paul, thanks, but your answer is not clear. "Yes" to both what? Can you point it out please?

toothandnail 09-27-2010 07:33 PM

Quote:

Originally Posted by Mr. Alex (Post 4109489)
Paul, thanks, but your answer is not clear. "Yes" to both what? Can you point it out please?

Sorry. You should use both the hosts.deny and hosts.allow section of /etc/samba/smb.conf. In addition to the IP addresses that you specify for hosts.allow, you also need to add localhost, otherwise there will be errors.

Hope that is clearer.

Paul.

Mr. Alex 09-28-2010 06:52 AM

Much better now. Thanks. Will use it.


All times are GMT -5. The time now is 03:33 AM.