Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients and can integrate with a Microsoft Windows Server domain, either as a Domain Controller (DC) or as a domain member. As of version 4, it supports Active Directory and Microsoft Windows NT domains.
Samba runs on most Unix, OpenVMS and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple’s macOS Server, and macOS client (Mac OS X 10.2 and greater). Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. Samba is released under the terms of the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the proprietary protocol used by the Microsoft Windows network file system.
Add user for samba
sudo smbpasswd -a sonik
Make a directory to share:
mkdir /home/sonik/sarg mkdir /home/sonik/publicCode language: PHP (php)
Edit the config file:
Add at the bottom of the file the new directory that we created:
[sarg] # This share allows only authenticated users path = /home/sonik/sarg available = yes valid users = sonik read only = no browseable = yes public = yes writable = yes [guest] # This share allows anonymous (guest) access # without authentication! path = /home/sonik/public read only = no guest ok = yesCode language: PHP (php)
sudo /etc/init.d/samba restart
Test samba config:
How to check samba version?