0

I cannot create files and directories of the root folder of a mounted Samba share on my Pi4. I am 98% certain that this is a client-side issue with the Pi4 and not a server configuration problem for two reasons:

  1. I can create new folders in the root of the share from my Mac
  2. Once inside a folder, I can create, modify, & delete folders & files as I please.

The relevant fstab line is //192.168.0.15/music /media/music cifs user,credentials=/usr/local/etc/whisper.credentials,uid=1000,file_mode=0664,dir_mode=0775,gid=adm,x-systemd.automount 0 0

The folder permissions on the mount folder say that I should have access to modify the files of the share's root folder. However, I can't create a test folder even with sudo.

Examples

  • mkdir /media/music/test fails with "Permission denied", even with sudo on the Pi4. Its equivalent command works flawlessly with my Mac as the client.
  • rm /media/music/Fiona_Apple/test.file works on the Pi and my Mac.
5
  • it's the server that is denying permission, so it's more likely a server config issue Jun 8, 2020 at 2:10
  • …but what is allowing my Mac to create the folders that my Pi can’t? I don’t recall setting up different logins or server settings for the different clients.
    – cjm
    Jun 8, 2020 at 2:13
  • so the mac and pi have identical settings? Jun 8, 2020 at 2:16
  • To the best of my knowledge. They both log into the same server hosted on my Pi3 with the same credentials. The biggest difference that sticks out right now is that the mac doesn't use /etc/fstab and uses something Apple-made in its place. That is why I suspect that it's something wrong with my mounting options instead of server-side (though it could still be a configuration issue).
    – cjm
    Jun 8, 2020 at 3:21
  • Removing the uid=1000 did not change the results in my desired direction. It also did not stop the share from successfully mounting.
    – cjm
    Jun 10, 2020 at 1:33

3 Answers 3

1

Is credentials=/usr/loca/etc/whisper.credentials a copy/paste error as it should be /usr/local/etc ?

The Mac authorises through smb and keychain so it is possible you are using a different user than the local one on the Pi.

0664 does not allow any User / Group execution rights and in Linux, users / groups must have the execution right to create directories.

1
  • That was a typo in the question and not my fstab. I edited the question. Do I need the execution right on files to create directories? 775 for directories should satisfy all that.
    – cjm
    Jun 8, 2020 at 3:37
0

I found success by editing the username field of whisper.credentials from username=WORKGROUP/user to username=user.

1
  • Please accept your own answer with a click on the tick on its left side. Only this will finish the question and it will not pop up again year for year.
    – Ingo
    Jun 13, 2020 at 7:58
0

There are two users involved in making a SMB connection. On my machine my mount command is

mount.cifs //wormtongue.local/myrepo /home/pi/Code/gitrepo/ -o user=pi,uid=pi

user=pi states I am logging in under the user pi as described in wormtongue's samba.conf. The second user uid=pi is the local user Raspbian will allow to create files on the share. Miss uid= out and you will only be able to create files using sudo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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