Connect with Samba (windows 10)

  • Platform information: Openhabian
    • Hardware: Raspberry Pi 3B+
    • OS: Windows 10

Hi,

I am setting up openHAB for a small company network. I got OH to work on the Pi and can connect to it with my laptop using the static IP of the Pi.

The problem is, I cant use the windows 10 file explorer to connect to the samba share.
I tried \IP\openHAB-conf, and the system finds the folder, but the login credentials are always wrong.

The first time I am trying to connect, it always tried to use the company domain for the samba login:

Username: Company\openhab
Password: ***

I’ve tried \openhab, \openhabian, company\openhab, company\openhabian, …

But I always get the message that I cant connect to the folder.
I’ve checked the samba status on the Pi, its active. Ive changed the samba password on the Pi, doenst work either.

Any ideas?

It should be the same login as you use with ssh or directly to pi.

So the pi username and pi password

It works with the xplore file browser on my phone with, as youre saying, the ssh username and password.
So it seems to be a network/windows 10 problem here :confused:

Unless you went through adding the system to a domain this is not going to work, have you tried the name of the Pi or IP where you have company? Do you have other OS options on this network to verify if it is a Windows 10 specific issue?

The problem is that the Pi with OH installed is connected to the WiFi of my company, while my laptop is connected with LAN, and for this case the name of the Pi or localhost wont work.
With the internal IP I can connect to the 8080 ports in the browser.
I will try to find a PC with windows 7 or linux to verify if its a W10 issue.

Different subnets are not an issue, I have a Windows 10 system at home (not bound to a domain) and OH in a different subnet and don’t have an issue reaching the samba shares on it.

Try VS Code (you’ll need Insiders for now) with the new Remote - SSH extension and get rid of samba.

I cant get RemoteSSH extension to work.
Do I have to change something on openhabian?
I tried connecting with openhabian@IPadress but it doenst seem to work

This uses key based authentication… https://vscode-westeu.azurewebsites.net/docs/remote/ssh#_connect-to-a-remote-host. Did you set that up? There are posts in the forum about how to do this for OH…

I set it up according to this tutorial:
Security of Karaf console (openhabian tutorial is down in the comments).

But I wont get it to work

Did you try the “SMB 1.0/CIFS File Sharing Support” in Windows Features?

Those instructions are to ssh into the Karaf console. You are looking to ssh into the host as openhab (or your file permissions will get messed up). To do this you need a login shell for the openhab account, but by default, openhab is configured with a non login shell. Here is how it is recommended to restrict the openhab account for a manual OH installation. It will vary by platform, but you may find in /etc/passwd…

openhab:x:964:963::/home/openhab:/bin/false

You will need to change this so that the openhab account has a shell…

openhab:x:964:963::/home/openhab:/bin/bash

Once you have a shell for the openhab account, you will also need to add your public key to the openhab user’s ~/.ssh/authorized_keys file (could be authorized_keys2 on some systems) on the OH server.

For some environments, this could be a security risk. If this is an issue for you, look into a restricted shell like rssh or chroot’ing OH.