Saaaaamba Headache

Hi
I have tried everything to get Samba share to work, watched every Youtube video etc. I have a Windows 10 pc, a Windows 7 pc and a MAC with OS10, on my network, non of these computers will connect to Samba.
Can it have something to do with my TPlink router? Is there another way to access the shares? Im using ESPhome and it is a pain not being able to access the files.

I have done the SMB1 protocol and numerous other things, nothing works.

Any advice appreciated.

Thanks

are you running Hassio and the addon or did you install from another method?

If the addon, what do the logs say (bottom of the add-on page)

If not hassio, what install method did you follow?

From you windows PC if you navigate to \\IPofyourHA\config (eg. \\192.168.1.2\config )in file explorer what happens?

I am running Hassio on rasp Pi3 with Add-on installed. If I type this “\192.168.0.126\config” I get.

hassio

Logs are below.

Denied connection from 192.168.0.119 (192.168.0.119)
Connection denied from ipv4:192.168.0.119:50525 to ipv4:192.168.0.126:445
Denied connection from 192.168.0.119 (192.168.0.119)
Connection denied from ipv4:192.168.0.119:50526 to ipv4:192.168.0.126:445
Denied connection from 192.168.0.119 (192.168.0.119)
Connection denied from ipv4:192.168.0.119:50528 to ipv4:192.168.0.126:445
Denied connection from 192.168.0.119 (192.168.0.119)
Connection denied from ipv4:192.168.0.119:50529 to ipv4:192.168.0.126:445
Denied connection from 192.168.0.119 (192.168.0.119)
Connection denied from ipv4:192.168.0.119:50530 to ipv4:192.168.0.126:445
Could not find child 103 – ignoring

Have you written the correct value behind the samba add-on parameter interface?

If yes, did you set a ‘username’ and ‘password’? During the process, are you asked to enter these?

Sorry, many questions but since you do not provide much information, these questions need to be asked. We could help you better when you would show the HA addon config information.

Hi
It never asks me for my username or password, it just comes up with the network error.
“Denied connection from 192.168.0.119 (192.168.0.119)” Is this HA denying the connection or my PC?

Below my config in Samba. i am connected to the Pi by “cable”, since my PC is in the 100 IP range i have changed the value below to 160.

"workgroup": "WORKGROUP",
  "username": "hassio",
  "password": "xxxxxxxx",
  "interface": "eth0",
  "allow_hosts": [
    "10.0.0.0/8",
    "172.16.0.0/12",
    "192.168.0.0/160"
  ]

More from the logs…

load_lmhosts_file: Can’t open lmhosts file /etc/samba/lmhosts. Error was No such file or directory
daemon_ready: STATUS=daemon ‘nmbd’ finished starting up and ready to serve connections
smbd version 4.8.8 started.
Copyright Andrew Tridgell and the Samba Team 1992-2018
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Processing section “[config]”
Processing section “[addons]”
Processing section “[ssl]”
Processing section “[share]”
Processing section “[backup]”
added interface eth0 ip=192.168.0.126 bcast=192.168.0.255 netmask=255.255.255.0
INFO: Profiling support unavailable in this build.
No builtin backend found, trying to load plugin
tdb(/var/lib/samba/registry.tdb): tdb_open_ex: could not open file /var/lib/samba/registry.tdb: No such file or directory
daemon_ready: STATUS=daemon ‘smbd’ finished starting up and ready to serve connections
waiting for connections

I looked in the etc. folder their is no Samba folder??

Remove the 0 from 160 so it reads as /16. That should be you issue.
See more info here about the number behind the /: https://arstechnica.com/civis/viewtopic.php?t=751834

Hi
IT WORKS, Thanks so much, cant believe it was me casing the problem.
Have a great weekend.

Glad I could help! Enjoy using Home Assistant :smile:

For future reference: “since my PC is in the 100 IP range i have changed the value below to 160”, is not how that format works.
What that format is called is CIDR Notation: https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Each of the 4 sections of an IP address can go from 0-255 which is represented by 8 bits in binary.
Just to reduce confusion, lets pretend you are using 192.168.10.119 instead of 192.168.0.119
192.0.0.0/8 would allow any IP to connect that started with 192. Use this for 255.0.0.0 subnet
192.168.0.0/16 would allow any Ip that started with 192.168. to work. Use this for 255.255.0.0 subnet.
192.168.10.0/24 would allow any ip that started with 192.168.10 to work. Use this for 255.255.255.0 subnet (most common for home/small office routers).
192.168.10.12/32 would ONLY allow 192.168.10.12 to work.
What you are doing with /x is specifying how many of the binary bits of the IP address must match

Assuming you are using 255.255.255.0 subnet then the best config for you would be 192.168.0.0/24. If you are using a 255.255.0.0 subnet then the 192.168.0.0/16 would be correct

You can actually use any number between 0 and 32 but explaining that (which requires explainig subnet math) would add another 4-5 paragraphs to the post.
Using /160 as you did just made it completely non-working invalid config.

1 Like