samba-2.0.3-19990228 (SMB)

WHAT IS SMB?

This is a big question.

The very short answer is that it is the protocol by which a lot of PC-related machines share files and printers and other informatiuon such as lists of available files and printers. Operating systems that support this natively include Windows NT, OS/2, and Linux and add on packages that achieve the same thing are available for DOS, Windows, VMS, Unix of all kinds, MVS, and more. Apple Macs and some Web Browsers can speak this protocol as well. Alternatives to SMB include Netware, NFS, Appletalk, Banyan Vines, Decnet etc; many of these have advantages but none are both public specifications and widely implemented in desktop machines by default.

The Common Internet Filesystem (CIFS) is what the new SMB initiative is called. For details watch http://samba.org/cifs.

WHY DO PEOPLE WANT TO USE SMB?

  1. Many people want to integrate their Microsoft or IBM style desktop machines with their Unix or VMS (etc) servers.
  2. Others want to integrate their Microsoft (etc) servers with Unix or VMS (etc) servers. This is a different problem to integrating desktop clients.
  3. Others want to replace protocols like NFS, DecNet and Novell NCP, especially when used with PCs.

WHAT CAN SAMBA DO?

Here is a very short list of what samba includes, and what it does. For many networks this can be simply summarised by "Samba provides a complete replacement for Windows NT, Warp, NFS or Netware servers."

  • a SMB server, to provide Windows NT and LAN Manager-style file and print services to SMB clients such as Windows 95, Warp Server, smbfs and others.
  • a NetBIOS (rfc1001/1002) nameserver, which amongst other things gives browsing support. Samba can be the master browser on your LAN if you wish.
  • a ftp-like SMB client so you can access PC resources (disks and printers) from unix, Netware and other operating systems
  • a tar extension to the client for backing up PCs
  • limited command-line tool that supports some of the NT administrative functionality, which can be used on Samba, NT workstation and NT server.

    For a much better overview have a look at the web site at http://samba.org/samba, and browse the user survey.

    Configure

  • It's a simple example /etc/smb.conf
    [global]
    workgroup = hoge
    server string = Samba Server
    coding system = EUC
    password level = 8
    guest accout = guest
    status = yes
    dead time = 360
    log file = /var/log/samba/log.%m
    log Level = 1
    
    [homes]
    comment = Home Directories
    read only = no
    browseable = no
    create mode = 0655
    
    [Public]
    comment = Public Directory
    path = /home/samba/
    public = yes
    writable = yes
    create mode = 0655
    write list = @users
    
    #[CD-ROM]
    #comment = WinServer CD-ROM Drive
    #path = /mnt/cdrom
    #public = yes
    #writable = no
    #printable = no
    

    How to start

    # /etc/rc.d/init.d/smb restart
    

    How to test

    # testparm | less
    

    Printer

  • Check lpd process
    # ps ax | grep lpd
      288  ?  S    0:00 lpd
    
  • /etc/smb.conf
    [global]
    ...
    load printers = yes
    ...
    
    [printers]
       comment = All Printers
       path = /var/spool/samba
       browseable = no
    # Set public = yes to allow user 'guest account' to print
       guest ok = no
       writable = yes
       printable = yes
    
  • /etc/printcap
    canon BJC-80v:\
            :sd=/var/spool/lpd/lp:\
            :mx#0:\
            :sh:\
            :lp=/dev/lp1:
    

    Samba Web Administration Tool

  • Edit /etc/services
    swat            901/tcp                         # Add swat service used via ined
  • Edit /etc/inetd.conf
    swat    stream  tcp     nowait.400      root    /usr/sbin/swat swat
    
  • Restart
    /etc/rc.d/init.d/inetd restart
    

    WINS (Windows Internet Name Service)

  • To be WINS Server
    [global]
    wins support   = yes
    domain master   = yes
    local master    = yes
    preferred master= yes
    os level        = 65
    
  • To be WINS Client
    [global]
    wins support   = no
    wins server     = 192.168.2.1
    

    Primary Domain Controler

  • To be a Primary Domain Controler /etc/smb.conf
    [global]
    workgroup       = hoge
    domain logons   = yes
    security        = user
    encrypt passwords = yes
    logon path      = \\%N\%U\Profiles
    smb passwd file = /etc/samba/smbpasswd
    
    [homes]
    writable        = yes
    browseable      = no
    hide dot files  = yes
    
    [Profiles]
    writable        = yes
    browseable      = no
    
    
    [netlogon]
    comment         = Network Login Service
    path            = /home/samba/netlogon
    writable        = no
    share modes     = no
    browseable      = no
    
    [cdrom]
    comment         = CD ROM
    path            = /mnt/cdrom
    read only       = yes
    public          = yes
    
    writable        = yes
    browseable      = no
    hide dot files  = yes
    
  • To be a file server /etc/smb.conf
    [global]
    workgroup       = hoge
    security        = share
    
    [share]
    path            = /home/samba/
    read only       = yes
    public          = yes
    

    Mount a SMB filesystem

    mount -t smbfs -o Options Source Destination
    Options
    Option Description Example
    username specifies the username to connect as. If this is not given then the environment variable USER is used. username=hogeuser
    password specifies the SMB password. If not given then smbmount will prompt for a passeword, unless the guest option is given. password=hogesecret
    ro mount read-only ro
    rw mount read-write rw
    mount -t smbfs -o username=hogeuser,password=hogesecret,ro //hoge-server/mp3 /home/mp3
    

    Back
    Google
    Web www.grape-info.com