0

I'm in the process of setting up a shared folder on my Raspberry Pi and am having a hard time figuring out the issue with some of my permissions. I set up my smb.conf file as such:

[content]
Comment = shared folder
Path = /mnt/content
read only = no
create mask = 0774
directory mask = 0774
valid users = @myadmingroup

I created a SMB user and added it to myadmingroup. I can access this folder but whenever I try to copy a file to the "content" directory it's saying I don't have permission. MacOS will first pop open a username/password dialog that says "Finder wants to copy 'filename.file'. Enter your password to allow this". I've tried entering my SMB credentials, as well as my Mac credentials but both fail. When I enter my SMB credentials, the dialog shakes like I entered the wrong username/password combo which leads me to think it wants my Mac credentials. When I enter those, it says "The operation can't be completed because you don't have permission to access some of the items".

Note: my username/passwords for my mac user and SMB user are different

Lastly, when I look at the permissions tab in the folder using VNC, it shows that the "Owner" and "Group" are both listed as PI. This also makes me think that Only PI has access to make changes to this directory. Can I just do a chmod on the folder and those settings will stick or do I need to make a change to smb.conf?

Thanks in advance!

  • Your question is unclear to me... did you create a new user on your mac? – Seamus May 19 at 5:14
1

Your question is vague, and this makes it difficult to provide a good answer. However, to be fair, until you understand some things about samba, it's not obvious how to phrase a question properly! A detailed, top-to-bottom explanation of how to setup samba requires quite a lot of explanation - too much for an answer here methinks. Therefore, I'll suggest that you take a look at this "recipe", and try to adopt it to your situation.

In general, here are the steps:

  • Make sure the drive you wish to share is properly mounted
  • edit the smb.conf file (the testparm command will check syntax)
  • add your Raspbian username (pi) to Samba's password database file
  • re-start Samba to read the revised smb.conf file
  • login from macos as user pi (note: pi is not a macos user)

It's useful to remember that there are two sets of permissions that apply to your Samba share (more details on this point are here):

  1. The permissions you set in your smb.conf file, and
  2. The permissions you set up under your host OS (raspbian, I assume)

Both sets of permissions must accommodate the access you desire. If they are different, you will get the most restrictive of the two sets of permissions.

| improve this answer | |
  • Thanks for the response and links, they definitely helped me learn a little more. Ultimately though, I saw this post (unix.stackexchange.com/a/206310) and added the line: force user = pi and it seemed to do exactly what I wanted; I'm able to edit files in that drive. Without knowing too much about samba though, is this the correct step? or is this a massive security vulnerability? – Josh May 19 at 15:34
  • No - it's not a security vulnerability. I almost suggested you try that - it was shown in the link I sent you, and I use it in my smb.conf. – Seamus May 19 at 20:18
  • Sounds good, thanks for your help! – Josh May 19 at 21:04

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.