Create a shared folder with restricted access to users within the smbgroup01 group. Authentication is required for access.
dnf -y install samba
groupadd smbgroup01
mkdir /home/share01
chgrp smbgroup01 /home/share01
chmod 770 /home/share01
vi /etc/samba/smb.conf
Add the following configurations:
[global]
unix charset = UTF-8
dos charset = CP932
workgroup = SAMBA
security = user
hosts allow = 127. 10.0.0.
...
[Share01]
path = /home/share01
writable = yes
guest ok = no
valid users = @smbgroup01
force group = smbgroup01
force create mode = 770
force directory mode = 770
inherit permissions = yes
systemctl enable --now smb
useradd cent
smbpasswd -a cent
# Follow the prompts to set a password for the user
usermod -aG smbgroup01 cent
For SELinux enabled systems using the /home directory, apply the correct policy:
setsebool -P samba_enable_home_dirs on
restorecon -R /home/share01
Allow Samba services through the firewall:
firewall-cmd --add-service=samba --permanent
firewall-cmd --reload
After completing these steps, your limited access shared folder will be ready for use by members of smbgroup01.