How to use Samba in Silverblue?

Fedora Silverblue, version 30.20190427.n.0

I see that some Samba configuration files are included in the base image, but there’s no Samba systemd service. How is Samba supposed to work in Silverblue?

$ ls /etc/samba/
lmhosts  smb.conf  smb.conf.example

$ systemctl list-unit-files --type=service | grep smb
$ systemctl list-unit-files --type=service | grep samba
$ systemctl list-unit-files --type=service | grep nmb

I’m missing something? Or should I report it in fedora-silverblue tracker?

At least on my system, I only have the samba client stuff installed:

$ rpm -qa | rg samba
samba-client-4.10.2-0.fc30.x86_64
samba-common-4.10.2-0.fc30.noarch
samba-client-libs-4.10.2-0.fc30.x86_64
samba-libs-4.10.2-0.fc30.x86_64
samba-common-libs-4.10.2-0.fc30.x86_64

If you want the server too, maybe try rpm-ostree install samba.

1 Like

Oh, sure. I should have checked the uninstalled samba packages.

One more question: if /etc/samba/smb.conf is part of default ostree image, my edits in this file will be overwritten if an image upgrades it?

Nope, OSTree special-cases /etc and merges all the config files on update.

so this is how you search for included packages! yes, I am new to Fedora

1 Like

I created samba share but I cannot get it working - can’t access it from network and not even locally using nautilus. sudo journalctl -f -u smb.service complains:

smbd[14722]: make_connection_snum: canonicalize_connect_path failed for service share, path /var/mnt/share

the directory is readable (incl. parent dirs) as drwxr-xr-x
I changed only these lines in /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
security = user
guest account = nobody       ← changed it here

username map = /etc/samba/username.map    ← changed it here
passdb backend = tdbsam

[share]
path = /var/mnt/share
browseable = yes
guest ok = yes
read only = yes

Is there something else I need to configure to get samba working, like SElinux or a firewall?

Hi @omichalek,

Yes, your problem is SELinux is preventing access to samba. The link below should help and I also included another link to the Fedora Samba Guide.

SELinux fix: https://linux.die.net/man/8/samba_selinux

Fedora Samba Guide: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/servers/File_and_Print_Servers/

Thank you, I used this:
setsebool -P samba_export_all_rw 1

I also had to enable it in the firewall:
firewall-cmd --add-service=samba --permanent
firewall-cmd --reload

edit:
smb.conf reference: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

1 Like

Glad, I could help! :slightly_smiling_face: