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.
# yum install samba
Edit the /etc/samba/smb.conf file and set the following parameters:
First we start with the global section. This supports WIN3 to WIN-ME also.
You can give workgroup every name you want.
[global] workgroup = WORKGROUP server string = Samba %v netbios name = server1 hosts allow = 127.0.0.1/8 192.168.1.0/24 hosts deny = 0.0.0.0/0 security = user lanman auth = yes client lanman auth = yes client plaintext auth = yes client ntlmv2 auth = no guest account = nobody encrypt passwords = yes passdb backend = tdbsam follow symlinks = yes wide links = yes unix extensions = no keep alive = 30 os level = 255 wins support = yes local master = yes domain master = true
The home section is not shown in the shares. Only the user home dir is shown.
[homes] comment = Home Directories valid users = %S, %D%w%S browseable = no writeable = yes create mask = 0640 directory mask = 0750
[users] comment = Voor iedereen toegangelijk public = yes path = /home/users browseable = yes writable = yes create mask = 0660 directory mask = 0775 force group = users
For samba to export shares in the home and www dirs you have to enter:
# setsebool -P samba_export_all_rw on
# systemctl start smb # systemctl start nmb # systemctl enable smb # systemctl enable nmb
# firewall-cmd --permanent --add-service=samba # firewall-cmd --reload
# testparm
Samba doesn't use the normal user account, but has a own. That mean you neet to add these to the samba user database.
# smbpasswd -a user-name # smbpasswd -e user-name
# smbcontrol all reload-config