My Notepad

  • My Linux Notes
  • My Grid Notes
  • To do List
  • Sunday, April 16, 2006

     
    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

    Comments: Post a Comment



    << Home

    Archives

    December 2005   January 2006   February 2006   April 2006   May 2006   June 2006   July 2006   November 2006   February 2007   May 2007   June 2007   November 2007   February 2008   March 2008   April 2008   August 2008   December 2008   March 2009   April 2009   May 2009   June 2009   October 2009   November 2009   December 2009   May 2013  

    This page is powered by Blogger. Isn't yours?