How to setup Samba server on RHEL, Rocky Linux, AlmaLinux

Install

dnf install samba
setsebool -P samba_enable_home_dirs on

smbpasswd -a root

systemctl start smb
systemctl enable smb

open FW

firewall-cmd --add-service=samba --permanent
firewall-cmd --reload

add /srv share to smb conf

cat <<"EOT">> /etc/samba/smb.conf
[myfileshare]
        comment = My File Share
        browsable = Yes
        read only = No
        path = /myfileshare
        create mask = 0664
        directory mask = 0775
EOT

Fix SELINUX

chcon -t samba_share_t /myfileshare