December 18, 2023

Fedora 39 -- Samba

I had Samba running nicely under Fedora 38. Now that I have done a fresh install of 39, I need to reinstall Samba and copy my old configuration files.
dnf install samba
firewall-cmd --add-service=samba --permanent

Then I edit the configuration file:

vi /etc/samba/smb.cnf
Rather than copying a 7 year old file into place, I am examining my old file and doing my best to change what I should, namely:
workgroup
And I copy two sections verbatim from the end (public and photos) to define the shares as Z and P drives respectively. I do this to check it:
testparm
To migrate my user and password setup, I do what I did back in 2017, namely copy these files:
cd /var/lib/samba/private
-rw-------  1 root root 421888 Dec 18 15:29 passdb.tdb
-rw-------  1 root root 430080 Dec 18 15:29 secrets.tdb
Now we launch the service:
systemctl enable smb.service
systemctl restart smb.service
This looks OK. Last time I had selinux throwing a fit, but we have already kicked that to the curb.

Try it out

I set all this up on Windows back around 2012 and have no notes on what I did to set it up on windows.

I go to my Windows machine and fire up Lightroom Classic. Something is wrong, Lightroom is telling me that the images are missing. (It sort of works because it has all kinds of cached previews).

I restart the windows machine. It takes forever. And it doesn't fix anything.

I don't need to use Lightroom to test this, I can use "File Explorer" and just investigate the Z: and P: drives.

Maybe it is some issue with the firewall, so try this:

systemctl stop firewalld
And bang! now it works. At least I can use Z: immediately from Windows.
I do some reading (see below) and now I do this:
systemctl stop firewalld
firewall-cmd --permanent --zone=FedoraWorkstation --add-service=samba
firewall-cmd --reload
And now it works. Clearly I need to learn about these firewall zones.

From the Windows side

I haven't found a need yet to install a special password. On the windows machine I login as tom and perhaps my regular password for windows is being used.

I accidentally deleted the P: share, so I have to set it up again. It is easy. I launch "This PC" (it used to be "My Computer") and at the top is a "button" that says "map Network drive". I click this and get a dialog. I select P: as the name and enter \\192.168.0.5\photos. The name "photos" is what I used in smb.conf for the share. Click finish and you are in business.

Start over from scratch

I thought I was going to have to do this, but then I decided to check if turning off the Firewall would fix things. Here are some links that I was starting to study. The Fedora link suggests:
su
firewall-cmd --get-active-zones
firewall-cmd --permanent --zone=FedoraWorkstation --add-service=samba
firewall-cmd --reload
You can use "reload" rather than stopping and starting the service.


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org