9

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.

2
  • Same thing happening to me while running a CentOS 8.
    – ranu
    Dec 3, 2019 at 18:49
  • @RafaelCamposNunes - Is your share connected to an AD (Active Directory)? Feb 24, 2020 at 11:43

3 Answers 3

7

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
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.

1

That shows that the linux ACL permissions are too restrictive for the user. You can relax the local permissions on the folder and configure the security settings within the samba service settings.

chmod 777 /home/andrius/Shared

Then, specify the given users or groups that have access within /etc/samba/smb.conf

[Shared]
path = /home/andrius/Shared
read only = no
valid users = andrius
write list = andrius

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.