Samba
The samba service on my linux server was not working after I moved to new place in Oxford, although I didnt change anything on SMB .
The reasaon is , the network range I used b4 in london is 192.168.1.0, but now its 10.0.0.0. And in the config file of SMB, "/etc/smb/smb.conf", by default , only 192.168.1.0/24, 192.168.2.0/24,127.0.0.0/8 are allowed, the following needs to be appended to this line:
10.0.
The setup of SAMBA service on linux is straight forward, most of the configuration is done in /etc/smb/smb.conf, the minimal necessary configurations in this file are:
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = TANG
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 163.1.26.
#Shared directory
[ktang_home_all]
path = /home/ktang
writeable = yes
browseable = yes
valid users = ktang
After you done all of these you will need to create smb users using smbpasswd command.
Note that only a exiting UNIX user on the server can be added as a samba user, e.g. to add ktang
as smb user, type:
smbpasswd -a ktang
The password doesn't have to be same with existing UNIX user account ktang.
Finally, don't forget to open samba service ports if you have a firewall such as iptables, etc. Both udp and tcp ports of 137-139 are required to be opened.
iptables -I INPUT -p tcp --source 163.1.26.0/255.255.255.0 --destination-port 137:139 -j ACCEPT
iptables -I INPUT -p udp --source 163.1.26.0/255.255.255.0 --destination-port 137:139 -j ACCEPT