File sharing with samba

Hi everyone,

I kindly ask for support for the configuration of a simple (which is accessible to guest users and therefore without an account on the system) samba server. on the net I have seen several guides some very old and I have not found a logical path to follow. Can you tell me a recent guide to follow? It all seems complicated or maybe it’s the guides I’ve seen that have confused my ideas.

kind regards

Easiest would be to install the package samba:

sudo dnf install samba

Create a directory:
$ mkdir -p /srv/smb-share

Set the permissions:

sudo chown root:root /srv/smb-share
sudo chmod 0766 /srv/smb-share

Set the SELinux context:

sudo semanage fcontext -a -t public_content_rw_t “/srv/smb-share(/.*)?”
restoren -Rv /srv/smb-share

Open the firewall:

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

Configure the service:

sudo vi /etc/samba/smb.conf
[smb-share]
comment = my public share
path = /srv/smb-share
read only = no
browseable = yes
guest ok = yes
:wq

Start the service:

sudo systemctl enable smb.service
sudo systemctl start smb.service

Good luck! :slight_smile:

1 Like