Samba

From vpsget wiki
Jump to: navigation, search

Opening firewall

Assuming your home subnet is 192.168.1.0

Add to "/etc/sysconfig/iptables" above the "REJECT" rule:

-A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 137 -j ACCEPT               
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 138 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT 
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 139 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -m state --state NEW -m udp -p udp --dport 445 -j ACCEPT

Restart firewall:

service iptables restart

Set permissions

groupadd WORKGROUP
useradd sambauser
usermod -G WORKGROUP sambauser
chgrp -R staff /home/sambauser