Table of Contents

Samba File Server


  1. apt-get install samba samba-common cups smbclient
  2. Add user to list of samba users:
    smbpasswd -a user
  3. Check whether samba user has been created with:
    pdbedit -L -v
  4. Change/verify the following entries in /etc/samba/smb.conf under [global]:
    workgroup = yourworkgroup
    server role = standalone server
    map to guest = bad user
  5. Add the following entries in /etc/samba/smb.conf under [global] below workgroup:
    server string = Samba Server %v
    netbios name = machinename
    security = user
  6. Modify entries under [homes]. This allows home directories to be shared read-only, with “user” having read/write access:
    browseable = yes
    read only = yes
    write list = user
    create mask = 0600
    directory mask = 0700
  7. Set up a file space share under [yourshare] which is named “yourshare”.
  1. Restart samba or the 2 samba services:
    /etc/init.d/samba restart
    systemctl restart nmbd.service
    systemctl restart smbd.service

Useful commands

  • Find computers and shares on the network:
    smbtree -b -N
    smbtree -b -U user%passwd
    smbclient -L machinename [user]
    smbstatus --shares
  • Connect a share:
    smbclient //machine/share -U user%passwd