Samba: sharing with Windows
Sign in to read this lesson
Office computers run Windows, and the file server is RHEL. Samba presents RHEL as a Windows network folder. We covered the basics in the Ubuntu course; in this lesson we add the two RHEL-specific layers — firewalld and SELinux (samba_share_t) — and mount the share from a Linux client.
What you will learn
- Server:
dnf install samba, a section in/etc/samba/smb.conf,testparm,systemctl enable --now smb. - The user must exist in Linux and gets a separate Samba password:
smbpasswd -a leyla; list withpdbedit -L. - firewalld:
--add-service=samba; SELinux: thesamba_share_tcontext on the directory (semanage fcontext+restorecon). - Linux client:
dnf install cifs-utils,mount -t cifs //srv-db01/hesabat /mnt/hesabat -o credentials=/root/.smbcred. - Do not write the password in fstab — a
credentials=file with mode600.
The lesson has 5 key points, an explanation and 5 questions. It opens with a package.