sudo vi /etc/samba/smb.conf
 
[global]
    # attenzione, di default il servizio tutto chiuso
    bind to interfaces only FALSE
    # Range di IP che possono accedere al server
    hosts allow = 127.0.0.1 192.168.1.0/255.255.255.0
    # Nome del gruppo di lavoro
    workgroup = WORKGROUP
    # Nome della macchina nel gruppo di lavoro
    netbios = SAMBA
    # Livello di sicurezza delle condivisioni
    security = USER
    # Descrizione della macchina
    server string = FILE SERVER
    # Permessi sulle cartelle
    create mask = 0755
hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24
hosts deny = 0.0.0.0/0
[www-site]
    guest ok = yes
    comment = www-site
    writeable = yes
    path = /var/samba/yourfolder
    delete readonly = yes
    public = yes
    writable = yes
    browsable = yes
    create mask = 0644
    force create mode = 0600
    security mask = 0555
    force security mode = 0600
    force user = youruser

dopo la configurazione, testa il file

    testparm
    sudo /etc/init.d/smbd restart
    # test connessione locale
    smbclient -L localhost -U%

da un'altra macchina:

    findsmb
    smbclient -L $IP

restrizione all'accesso:

sudo vi /etc/hosts.allow
smbd: 192.168.1.

GUI configurator:

sudo system-config-samba

mount remote share: in /etc/fstab file:

    //ntserver/docs /mnt/samba smbfs username=docsadm,password=D1Y4x9sw 0 0

assegnare un utente

  1. Each samba user must have a corresponding linux account, ensure the user have permission on the folder

or you can set `force user` in smb.conf

  1. Make sure each user has a samba password set.

`sudo smbpasswd -a your_user`

  1. check /etc/samba/smb.conf has the line `security=user` is set in the [GLOBAL] section
  2. sudo service smbd restart
; This will be accessible via \\yourserver\allaccess
[allaccess]
    path = /media/common
    read only = no
    writeable = yes
    browseable = yes
    valid users = one, two, three, four
    create mask = 0644
    directory mask = 0755
    ; if you set this, all files get written as this user
    force user = one
 
 
; A single user share:
[special]
    path = /home/two/onlytwo
    read only = no
    writeable = yes
    browseable = yes
    valid users = one
    create mask = 0640
    directory mask = 0750

NFS: nfs tra macchine unix è più veloce del 30%

/etc/fstab

    # device                 mountpoint    fs-type      options       dump fsckorder
    192.168.2.250:/Public  /mnt/Public   nfs          rw,soft,users,nolock            0    0
    #users: montabile dagli utenti
    #noauto: non montare al boot
    #nolock: non usare demone per il lock dei files