Two Pi devices, one lets me access samba shares, the other one doesn't

I have a working 32-bit OpenHAB 4.1.2 setup on Pi 3B+ and I can access its samba shares from windows 10 PC without issues. Typing \\192.168.1.151\ in windows explorer gives me read and write access to all the folders without loging in. Testing from different windows machine yields the same result (full access), so it’s not a case of stored password.

I’m trying to move everything to Pi 5 with 64-bit OpenHAB 4.2.1 installed. Samba installed through openhabian-config. Typing \\192.168.1.158\ in explorer shows me the 4 openHAB-* folders, but when I try to open any, I get a credentials prompt.

Both devices are cable connected to the same LAN.
Both have static IPs and are pingable from Windows machine.
Both use default settings in smb.conf, the smb.conf file has the same size and looks the same
There are no firewalls rules specific to any of those devices.

Pi 5 logs:

systemctl status smbd

● smbd.service - Samba SMB Daemon
     Loaded: loaded (/lib/systemd/system/smbd.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-09-11 14:42:10 CEST; 2h 49min ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 8861 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 9566)
        CPU: 6.255s
     CGroup: /system.slice/smbd.service
             ├─ 8861 /usr/sbin/smbd --foreground --no-process-group
             ├─ 8881 /usr/sbin/smbd --foreground --no-process-group
             ├─ 8882 /usr/sbin/smbd --foreground --no-process-group
             └─20105 /usr/sbin/smbd --foreground --no-process-group

Sep 11 14:42:10 openhabian systemd[1]: Starting smbd.service - Samba SMB Daemon...
Sep 11 14:42:10 openhabian systemd[1]: Started smbd.service - Samba SMB Daemon.
Sep 11 17:22:43 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:24:15 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:25:48 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:27:04 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:29:23 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:30:04 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody
Sep 11 17:30:15 openhabian smbd[20105]: pam_unix(samba:session): session closed for user nobody

openhab-cli info

Version:     4.2.1 (Build)

User:        openhab (Active Process 8716)
User Groups: openhab tty dialout audio bluetooth gpio

Directories: Folder Name      | Path                        | User:Group
             -----------      | ----                        | ----------
             OPENHAB_HOME     | /usr/share/openhab          | openhab:openhab
             OPENHAB_RUNTIME  | /usr/share/openhab/runtime  | openhab:openhab
             OPENHAB_USERDATA | /var/lib/openhab            | openhab:openhab
             OPENHAB_CONF     | /etc/openhab                | openhab:openhab
             OPENHAB_LOGDIR   | /var/log/openhab            | openhab:openhabian
             OPENHAB_BACKUPS  | /var/lib/openhab/backups    | openhabian:openhab

URLs:        http://192.168.1.158:8080
             https://192.168.1.158:8443

What am I missing?

It’s possible that you’ve cached the login credentials on Windows after connecting to the first RPi’s SAMBA shares so it doesn’t ask any more. IIRC there’s a check box to remember the credentials or something like that.

Use openhabian and what ever your ssh login password you use when logging into the second RPi as the credentials.

I tried to connect to Pi3 from different “fresh” windows machine - no issues there. I will edit my post, to make it clear.

I guess that the RPi you are having problems with, does not appear in your PC‘s explorer under Network, correct?
If that‘s the case, I had the same weird problem. I ended up installing „WSDD“ which makes Samba shares visible in your network.

sudo apt-get install wsdd

I installed wsdd on Pi 5 - didn’t help.
There is no wsdd packet istalled on Pi 3.
I don’t see Pi 3 samba shares in Windows network explorer, but I can easily access it using //IP.

One difference that I found:

Pi 3
apt list samba
samba/oldstable,now 2:4.13.13+dfsg-1~deb11u6 armhf [installed]

Pi 5
apt list samba

samba/stable,stable-security,now 2:4.17.12+dfsg-0+deb12u1 arm64 [installed]
samba/stable,stable-security 2:4.17.12+dfsg-0+deb12u1 armhf

Now that you see the RPi5 in your explorer, does it ask for credentials if you double click the icon?

If that doesn‘t help, goto control panel and click on the vault icon (don‘t know the english name of the module) and go to Windows credentials. Delete the stored credentials for the RPi5

@Oliver2 Yes, it still does, but after 7th restart openhabian:openhabian works, so I at least get access. Although I was under the inpression it should be my SSH credentials and not the default ones.

samba creadentials are independent of ssh credentials.
ssh will use the “real” unix user, samba does it’s own user management.
For example, you have to use smbpasswd to set the password for the given user.