You can easily limit access to the IPC$ share under Samba using hosts allow and hosts deny feature. Another option is firewall samba port and limit access within your own subnet so that only machines in your network will be able to connect to it. Open smb.conf and make [IPC$] set it as follows:
Save and close the file. Restart samba:
[IPC$]
hosts allow = 10.0.0. 127.0.0.1
hosts deny = 0.0.0.0/0
/etc/init.d/smb restartUse iptables to restrict access
You can also add something as follows to your iptables script (/etc/sysconfig/iptables under CentOS / RHEL / Fedora Linux)Save and close the file. Restart iptables:
-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -m state --state NEW -p tcp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -m state --state NEW -p tcp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -m state --state NEW -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -s 10.0.0.0/8 -m state --state NEW -p tcp --dport 445 -j ACCEPT
# service iptables restart
No comments:
Post a Comment