Have added samba, can see the share but dont have permission

Can someone please tell me the command to add permission to allow me to connect to the samba share ?

After setting up samba and adding a password sudo smbpasswd -a pi I can see the network share but dont have permission to connect to it.

can someone please tell me the command to add read write access to the samba share? please?

Can you post your Samba Configuration file (smb.conf), at least the part that pertains to the sharing of your Home Assistant configuration directory?

It’s likely a permissions issue there.

Thank You in advance

[global]
netbios name = raspberrypi
server string = The Pi File Center
workgroup = WORKGROUP
hosts allow =
remote announce =
remote browse sync =

[HOME ASSISTANT]
path = /home/homeassistant/.homeassistant
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777

Try adding this to the end and then restart samba:

force user = root
force create mode = 0775
force directory mode = 0775
hosts allow =

You can change the permissions to 0777 if you like

1 Like

Now my file looks like this but I still dont have permission to connect the the samba share

[global]
netbios name = raspberrypi
server string = The Pi File Center
workgroup = WORKGROUP
hosts allow =
remote announce =
remote browse sync =

[HOME ASSISTANT]
path = /home/homeassistant/.homeassistant
comment = No comment
browsable = yes
read only = no
valid users =
writable = yes
guest ok = yes
public = yes
create mask = 0777
directory mask = 0777
force user = root
force create mode = 0777
force directory mode = 0777
hosts allow =
force user = root
force create mode = 0775
force directory mode = 0775
hosts allow =

Are you sure the path is /home/homeassistant/.homeassistant and not /home/hass/.homeassistant?

Did you use the All-In-One installer?

are you asking about the path to my configuration.yaml ? if so then yes im sure.

I have attached a screen clip of the path to my configuration.yaml file

Hmmm, as far as I can tell, you got the bases covered. However, check out this video and see if there are any differences in how yours is set up

BRUH Automation: Setting up Samba

The default Samba configuration file has quite a bit in it, so there may be another setting somewhere that is causing issues.

2 Likes

Is there an easy way to recover the original smb.conf file information?

Your homeassistant section requires you to login to samba using the homeassistant user.

Before you can do this, you have to set up homeassistant user with a samba password.

I don’t use it any more, so I can’t remember the exact configuration details, but hopefully that is something to look for.

Typically, when I would like to keep a copy of the original file for such occasions, I will just make a copy of the file in the same directory. For example, using the samba configuration file:

sudo cp smb.conf smb.orig

Assuming you are running that command from inside the directory where the samba configuration file is located. It’s probably not a bad idea to get in the habit of using full paths so it wont matter as much where you are in the file structure:

sudo cp /etc/samba/smb.conf /etc/samba/smb.orig

However, to answer your question more directly, there is not an easy way that I am aware of. You could probably google for smb.conf and come up with something.

I think that:

  • If your user is homeassistant, you should set that user up in samba (with smbpasswd) and then uncomment the [homes] section in smb.conf
  • or, as it seems you choose another user (pi) maybe you should add that to the share definition:
    valid users = pi

then you should be able to access the share, but maybe still have permissions issues.

gl

1 Like

I had similar samba permission problems, on the Mac.
I used the manual in the BRUH video, changed the folder to the .homeassistant folder, did not make a pi user, since I already had a pi user from my manual HA installation on the RPi.
I restarted samba service and logged in on my iMac with user pi and password of the pi user. I could mount both volumes and edit, create and delete. Beautiful. No more silly copy/paste in nano. I use textwrangler on the Mac now.

For full folder permissions you may want to remove the 0775 lines in the smb.conf that you added last since they supersede the 0777 lines.

I think maybe you need to run the command

sudo smbpasswd -a homeassistant

for user homeassistant, not user pi, with a password to login from another station. You appear to be under user “homeassistant” on your Pi.

Thanks, that worked for me.

1 Like

Thanks all, I think the line:

sudo smbpasswd -a homeassistant

also changing the location to:

/home/homeassistant/.homeassistant