Linux: Samba and SMB - Paiet/Tech-Journal-for-Everything GitHub Wiki
- Server Message Block (SMB)
- Proprietary file sharing protocol developed by Microsoft
- Sometimes referred to as Common Internet File System (CIFS)
- Samba is an open source implementation of SMB
- Created by reverse engineering the protocol
- Not all features are supported, but stable compatibility has been reached
- File and Printer Sharing
- RHEL can be an AD domain member
- Cannot be a domain controller
- Configure a Samba Server
- Install Samba
-
sudo yum install samba samba-client samba-common
x. Create user accounts (if authenticating) sudo useradd dpezet
sudo groupadd employees
sudo usermod -a -G employees dpezet
sudo smbpasswd -a dpezet
-
- Create shared folders
sudo mkdir -pm 755 /shares/public
sudo chown -R nobody:nobody /shares/public/
sudo mkdir -m 770 /shares/private
sudo chown -R dpezet:employees /shares/private/
- Configure the Samba service
sudo vi /etc/samba/smb.conf
- See example config below
- Allow Samba in SELinux
sudo chcon -t samba_share_t /shares/public/
sudo chcon -t samba_share_t /shares/private/
- Allow Samba clients through the firewall
firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload
- Start Samba
sudo systemctl enable --now smb.service nmb.service
- Install Samba
- Configure a Samba Client
Places -> Network -> Windows Network
[global]
netbios name = FILESERVER
map to guest = bad user
dns proxy = no
security = user
workgroup = WORKGROUP
# Active Directory mode
# security = ADS
# realm = <domain_fqdn>
# password server = <pdc_emulator_fqdn>
[public]
path = /shares/public/
browsable = yes
writable = yes
guest ok = yes
read only = no
[private]
path = /shares/private/
# valid users = <username> <username> ...
valid users = @employees
browsable = yes
writable = yes
guest ok = no
read only = no