Samba - guest sharing folder doesn't work

I’ve been try to create a guest shared folder in my Fedora 40 KDE spin without success.
These are the follow steps I made so far:

1 - create a directory for share

sudo mkdir /mnt/data/shared_folder
sudo chmod -R 777 /mnt/data/shared_folder

2 - install Samba server:

sudo dnf install samba

3 - set firewall

  • open firewall
  • choose FedoraWorkstation Zone (the actually active zone)
  • set Samba and Samba-client service on

4 - configure Samba server:

sudo nano /etc/samba/smb.conf

(Add in the end of to the smb.conf the follow lines)

	[shared]
		path = /mnt/data/shared_folder
		guest ok = yes
		guest only = yes
		writeable = yes
		browsable = yes

5 - restart samba service

sudo systemctl restart smb

This configuration is suppose to be enough but the Fedora doesn’t give me access to the shared folder created despite it is shown when I try to access it from Dolphin→Network→Shared Folders (SMB) → MyPC.
I also tried several variation to configure the smb.conf without success like adding:

[global]
	usershare allow guests = yes
	map to guest = bad user
	server role = standalone server

[shared]
	public = yes
	read only = no

What am I missing?

1 Like

having the same issue

Can you use smb://foldername or smb://ipaddress to get into the folder from dolphin.

hey,
Nop. I can see the directory [shared] but it is empty (despite I add some files).

SELinux related settings, see:
How to create a Samba share :: Fedora Docs

1 Like

Hey Vlad,

I already read this doc before and there is nothing about guest shared folder.

This is basically what the linked documentation expects you to do:

SHARE="/mnt/data/shared_folder"
sudo semanage fcontext -a -t samba_share_t "${SHARE}(/.*)?"
sudo restorecon -F -R -T 0 "${SHARE}"
1 Like

Hey Vlad!

It works now! Thanks!

Just a note, the samba service was set to inactive after restart. It is not clear to me why. Then I just run the follow command to enable it for the next restart:

sudo systemctl enable smb

and to activate it in the current section I ran:

sudo systemctl restart smb

1 Like

For security reasons.
Here’s the relevant policy:
Default Services :: Fedora Docs

1 Like