Samba change_to_user_internal error when accessing the share
I am getting the following error when trying to access samba share.
[2019/02/24 20:24:48.978082, 0] ../source3/smbd/uid.c:386(change_to_user_internal)
change_to_user_internal: chdir_current_service() failed!
I have created folder gave it 777 permissions chowned it to nobody user but no matter what I try it won't let me open it.
Here is the smb.conf
[global]
map to guest = Bad User
workgroup = WORKGROUP
server string = Samba Server
server role = standalone server
dns proxy = no
[Shared]
comment = Allow all users to read/write
path = /home/andrius/Shared
public = yes
guest ok = yes
writable = yes
The problem seems to be related to an issue that the folder I am trying to share is located in my home directory. As soon as I place it outside home directory things start to work.
smb.service
seems to be running as root service when I check the processes. So what I am strugling to understand why I can't have it in my home directory.
Solution 1:
I was having the same issue, I found the solution in another question.
You need to add a force user =
parameter. (pick the user carefully, any files created will be owned by this user.)
[Shared]
comment = Allow all users to read/write
path = /home/andrius/Shared
public = yes
guest ok = yes
writable = yes
force user = andrius
Solution 2:
I had the same issue, but my solution was different: The folder above my smb-shared folder was not readable by samba-user, so the user can't cd into this folder... solution was to give the folder above the right rights.