# Install samba v3 first, stop it, then replace original binaries by new and start again. # Dont forget edit smb.conf! apt-get install samba service samba stop tar xvfz Samba4_from_original.gz -C /usr/sbin/ nano /etc/samba/smb.conf service samba start #=========================================================== #======================= Additions ========================= #=========================================================== # For smbauth: touch /etc/samba/smbpasswd # Create new user: adduser username # Set password: smbpasswd -a username # Addhem to group (If need auth by groups): usermod -G users username #=========================================================== #======================= My smb.conf ======================= #=========================================================== [global] workgroup = WORKGROUP server string = %h server wins support = no dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d security = user lanman auth = no main protocol = NT1 encrypt passwords = true passdb backend = smbpasswd obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes map to guest = bad user ########## Printing ########## # load printers = yes # printing = bsd # printcap name = /etc/printcap # printing = cups # printcap name = cups ############ Misc ############ socket options = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536 # domain master = auto usershare max shares = 100 usershare allow guests = yes ############ Samba v4 misc ############ write cache size = 2097152 use sendfile = yes getwd cache = yes #======================= Share Definitions ======================= [homes] comment = Home Directories browseable = no read only = no create mask = 0700 directory mask = 0700 valid users = %S #[profiles] # comment = Users profiles # path = /home/samba/profiles # guest ok = no # browseable = no # create mask = 0600 # directory mask = 0700 [printers] comment = All Printers browseable = no path = /var/spool/samba printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no write list = root, @lpadmin #[cdrom] # comment = Samba server's CD-ROM # read only = yes # locking = no # path = /cdrom # guest ok = yes # preexec = /bin/mount /cdrom # postexec = /bin/umount /cdrom # My /dev/sda4 mounted in /data [Data] path=/data/Data browseable=yes writeable=yes valid users=@users admin users=username [Public] path=/data/Public browseable=yes writeable=yes guest only=yes