Trouble setting up an anonymous samba share

Hello,

i’m trying to setup a read and writeable samba share on a second internal disk. So far i can see the share on my windows 10 machine, but i cannot access it: “You do not have permission to access…”

My smb.conf looks like:

[global]
workgroup = WORKGROUP
wins support = yes
security = user
map to guest = bad user

[sambashare]
comment = SambaShare
path = /mnt/wwn-0x5000039a756056c3/samba-share
browseable = yes
writeable = yes
guest ok = yes
guest only = yes
read only = no
force user = nobody
create mode = 0644
directory mode = 0755

I’ve tried so many different things with no success. Maybe someone can help me to debug this, thx!

Have you added yourself to samba users with
sudo smbpasswd -a username
Also make sure your drive is mounted correctly. You can check in Gnome Disks.It may show something like /run/media/username/samba-share.If it does change the path to that if your trying to share the drive.

If i add my user with

sudo smbpasswd -a username

it kinda gets worse, i can’t even connect to the fedora machine without being prompted for a username or password. But my username and password don’t work.

Hi, I’ve used Fedora for like a week so this might not necessarily be relevant but one thing I wasn’t used to or prepared for when attempting to share via samba and nfs was selinux. The fedora page guide about samba starts with five pages on selinux but someone on a forum mentioned that there’s primarily one bool that needs to change so if you do
getsebool -a | grep 'samba'
what do you get? Only offs? If so you may try
sudo setsebool -P samba_export_all_ro 1
to allow samba read access. (It’s ‘rw’ for read+write)

The firewall needs to allow samba connections too. Well, I followed this guide: How to setup Samba on Fedora the easy way? - #24 by isaque

$ getsebool -a | grep ‘samba’
samba_create_home_dirs → off
samba_domain_controller → off
samba_enable_home_dirs → off
samba_export_all_ro → off
samba_export_all_rw → on
samba_load_libgfapi → off
samba_portmapper → off
samba_run_unconfined → off
samba_share_fusefs → off
samba_share_nfs → off
sanlock_use_samba → off
tmpreaper_use_samba → off
use_samba_home_dirs → off
virt_use_samba → off

samba_export_all_rw should do the trick? whats the difference between “rw” an “ro”?

$ firewall-cmd --list-services
dhcpv6-client mdns samba ssh

firewall should be fine too

“rw” is read write, “ro” is …er, “read only” maybe :slight_smile:
Both selinux and the firewall service look good then. Perhaps something is off with your samba share definitions, I’m not aware of your global options or half of the others. I’m usually sharing a folder of my user’s home folder with a /etc/samba/smb.conf as short as five lines; there’s no global section.

You can run “testparm” to see that your smb.conf looks good syntactically. Beyond that I hope someone better at samba than me can help : )

ha, yeah, obvious now that you say it :slightly_smiling_face:
thanks for your help