Upgrade openhabian destroys samba

Hello,
i upgraded from OH3 to OH4. For this upgrade, i have to upgrade the linux basesystem first. I have installed a old openhabian verison, so i upgraded the linux to the newest. After this upgrade, i cannot access the samba shares. I deleted samba complete and installed it via openhabian-config. but without success. i cannot see any errors, but from my desktop pc i cannot reach the raspberry shares. do you have any idea what i can do?

I´m not familiar with Openhabian, so I´d start on linux level.

Start with testparm to check for errors in smb.conf.
Then check locally, if samba shares are visible.
Then in Windows via IP, later via your linux box name

Hey,
thanks for your reply.

Here are the result of checkparam:

Load smb config files from /etc/samba/smb.conf
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        dns proxy = No
        log file = /var/log/samba/log.%m
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        syslog = 0
        unix password sync = Yes
        wins support = Yes
        idmap config * : backend = tdb


[openHAB-addons]
        comment = openHAB addons
        create mask = 0664
        delete veto files = Yes
        directory mask = 0775
        path = /usr/share/openhab/addons
        read only = No
        veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/


[openHAB-conf]
        comment = openHAB site configuration
        create mask = 0664
        delete veto files = Yes
        directory mask = 0775
        path = /etc/openhab
        read only = No
        veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/


[openHAB-userdata]
        comment = openHAB userdata
        create mask = 0664
        delete veto files = Yes
        directory mask = 0775
        path = /var/lib/openhab
        read only = No
        veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/


[openHAB-sys]
        comment = openHAB application
        create mask = 0664
        delete veto files = Yes
        directory mask = 0775
        path = /usr/share/openhab
        read only = No
        veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/._*/

How can i check the samba shares locally? Do you have a commandline expression for me?

Edit:
i try the following:

openhabian@openhab:/var/log/mosquitto $ sudo smbclient --list $(hostname -s)
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
do_connect: Connection to openhab failed (Error NT_STATUS_CONNECTION_REFUSED)

  • Is name server resolving working probably? Looks like “hostname -s” tries to resolve as part of the command. Maybe try at first a command “hostname -s” only to watch for the output and later “smbclient -L localhost” at first to eliminate potential errors here
  • Do you have an existing user with access rights? Also watch for /var/log/samba/ log files.
  • User rights appropriate for the target directories?

I’d (re-)set the Samba password first. Somewhere in the 1X options I think.

openhabian@openhab:~ $ hostname -s
openhab
openhabian@openhab:~ $ smbclient -L localhost
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
do_connect: Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)

I have already changed the password, but without access. the folder rights are all correct. i dont have any clue whats going wrong here…

Hmm … new ideas

  • smbclient without providing a user name takes the current user “openhab”. Is this user set up for samba?
  • Check /etc/resolv.conf
  • Check IP being bound to samba. Maybe a wrong interface?
  • A firewall issue might apply, if connections to localhost/openhab are not possible

Is your smbd service up and running?

sudo systemctl status smbd.service
openhabian@openhab:~ $ nano /etc/resolv.conf
  GNU nano 5.4                                                                                                   /etc/resolv.conf
# Generated by resolvconf
domain fritz.box
nameserver 192.168.178.1
openhabian@openhab:~ $ sudo netstat -plaunt | egrep "ntp|bind|named|samba|?mbd"
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      13308/smbd
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      13308/smbd
tcp6       0      0 :::445                  :::*                    LISTEN      13308/smbd
tcp6       0      0 :::139                  :::*                    LISTEN      13308/smbd
openhabian@openhab:~ $ smbclient -L openhab
lpcfg_do_global_parameter: WARNING: The "syslog" option is deprecated
Enter WORKGROUP\openhabian's password:

        Sharename       Type      Comment
        ---------       ----      -------
        openHAB-addons  Disk      openHAB addons
        openHAB-conf    Disk      openHAB site configuration
        openHAB-userdata Disk      openHAB userdata
        openHAB-sys     Disk      openHAB application
        IPC$            IPC       IPC Service (Samba 4.13.13-Debian)
SMB1 disabled -- no workgroup available

But if i wanted to connect a network drive in windows 11 i see nothing. i try the IP( 192.168.178.134) and the hostname (openhab)

But after a restart of the smbd service, i’m able to login with smdbclient and see the shares… thats a small success…

Edit:
i have added the following to sama.conf

protocol = SMB3

After restarting the service the shares will work! thanks alot!

1 Like