4.1 Samba tiedostopalvelimena

  1. Asenna samba komennolla apt-get install samba

    Workgroup/Domainname? testgroup tai test.com Use password encryption? Yes Modify smb.conf to use WINS settings from DHCP? No How do you want to run Samba? daemons Create samba password database, /var/lib/samba/passdb.tdb? Yes

  2. Muokkaa tiedosto /etc/samba/smb.conf seuraavaan muotoon:

    [global]
    
    # Jos tulee hidastusta ja pätkimistä tiedostoja avattaessa 
    # oplocks = no
    # Jos työasemat toimivat ongelmitta, kannattaa arvoksi 
    # laittaa yes.
    oplocks = no
    
    # työryhmänimi
    workgroup = WORKGROUP
    
    passdb backend = tdbsam guest
    
    # palvelimen tunniste (palvelimen kuvaus) 
    server string = %h server (Samba %v)
    
    # root-käyttäjä ei ole sallittu
    invalid users = root
    
    # vain 192.168.1.0 -verkolle sallittu
    allow hosts = 192.168.1.
    
    # näkyy windows verkossa
    browseable = yes
    
    # määrittää, että jokaisella yhdistävällä työasemalla on 
    # oma lokitiedosto
    log file = /var/log/samba/log.%m
    
    # Put a capping on the size of the log files (in Kb).
    max log size = 1000
    
    # logitustaso 
    syslog = 0
    
    # "security = user" on aina hyvä idea. Näin kaikilta 
    # samba-serverin käyttäjältä vaaditaan Unix-tili 
    # järjestelmässä.
    security = user
    
    # salasanojen salaus 
    encrypt passwords = true
    
    # optimointia 
    socket options = IPTOS_LOWDELAY TCP_NODELAY \
    SO_SNDBUF=8192 SO_RCVBUF=8192 SO_KEEPALIVE
    
    # verkkokortit, joiden kautta samba jakaa 
    interfaces = eth0 192.168.1.0/24
    
    # ainut serveri verkossa
    local master = yes
    
    # kuinka paljon samba mainostaa itseään verkossa 
    os level = 20
    
    # Domain Master specifies Samba to be the Domain Master 
    # Browser. This allows Samba to collate browse lists 
    # between subnets. Don't use this if you already have a
    # Windows NT domain controller doing this job 
    domain master = auto
    
    # Preferred Master causes Samba to force a local browser 
    # election on startup and gives it a slightly higher 
    # chance of winning the election
    preferred master = auto
    
    # --- End of Browser Control Options ---
    
    # This will prevent nmbd to search for NetBIOS names 
    # through DNS.
    dns proxy = no
    
    # What naming service and in what order should we use to 
    # resolve host names to IP addresses
    name resolve order = lmhosts host wins bcast
    
    # This boolean parameter controlls whether Samba attempts 
    # to sync. the Unix password with the SMB password when 
    # the encrypted SMB password in the /etc/samba/smbpasswd 
    # file is changed.
    unix password sync = no
    
    # For Unix password sync. to work on a Debian GNU/Linux 
    # system, the following parameters must be set (thanks to 
    # Augustin Luton <aluton@hybrigenics.fr> for sending the 
    # correct chat script for the passwd program in Debian 
    # Potato).
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n \
    *Retype\snew\sUNIX\spassword:* %n\n .
    
    
    obey pam restrictions = yes
    
    unix charset = ISO-8859-15
    
    #=================== Share Definitions ==================
    # Määritellään kaikille yhteinen sekä jokaiselle 
    # käyttäjälle henkilökohtainen hakemisto
    
    [yhteinen]
    comment = yhteinen
    path = /home/yhteinen
    public = yes
    create mask = 0777
    directory mask = 0777
    force create mode = 0777
    force directory mode = 0777
    writable = yes
    
    [pc1]
    comment = pc1
    path = /home/pc1
    valid users = pc1
    public = no
    create mask = 0770
    directory mask = 0770
    force create mode = 0770
    force directory mode = 0770
    writable = yes
    



Lauri Laukkarinen 2006-03-23