0

I asked this over at superuser already but didn't get much input on it.

I have a Mac (El Capitan 10.11.6) client that is connected to an Ubuntu server (18.04 LTS) running Samba, sharing a ZFS pool. Everything works great, except that whenever I add a file to the server, the permissions are changed.

For example, here's foo.txt on the mac:

$ ls -l foo.txt
-rw-r--r--  1 leetbacoon  staff  160 Feb 21 15:37 foo.txt

When it is clicked and dragged to the server, the server copy changes the attributes:

$ ls -l /Volumes/SMB\ Share/foo.txt
-rwx------  1 leetbacoon  staff  160 Feb 21 15:37 /Volumes/SMB\ Share/foo.txt*

Copying the file from the server back to my Mac retains those permissions:

$ ls -l ./Copied\ From\ Server/foo.txt
-rwx------  1 leetbacoon  staff  160 Feb 21 15:37 ./Copied\ From\ Server/foo.txt*

I want to have the file permissions retained when copying to the server, i.e.:

$ ls -l /Volumes/SMB\ Share/foo.txt
-rw-r--r--  1 leetbacoon  staff  160 Feb 21 15:37 /Volumes/SMB\ Share/foo.txt

All the ls -l commands were executed on the Mac client.

5
  • @Podesta tried that and the file it did it again, turned the file into -rwx------ – leetbacoon Mar 17 '19 at 6:55
  • even just to test, tried chmod 777 /Volumes/SMB\ Share/foo.txt and still only gave me -rwx------ – leetbacoon Mar 17 '19 at 6:57
  • @Podesta something else really strange is the fact that when i ssh into my server and do ls -l i see foo.txt's permissions are -rwxr--r--. whaaaa??? chmod 777 foo.txt on the server changes it on the server to -rwxrwxrwx, but on the Mac i still see the -rwx------ i'll try out your suggestions shortly – leetbacoon Mar 17 '19 at 16:47
  • @Podesta i'm wondering if it is my smb.conf that's at fault, too. here's a copy of it in its entirety: pastebin.com/raw/sKzSmPx9 – leetbacoon Mar 17 '19 at 16:58
  • Thanks for the suggestion @Podesta, but neither work :-( i tried the first, then the second, then both, every time doing the same. – leetbacoon Mar 18 '19 at 0:27
1

What happens when you insert the following two lines in the share definition in smb.conf:

ea support = yes
vfs objects = catia fruit streams_xattr
map archive = No

And restart smbd:

sudo service smbd restart
6
  • Thank you, but it didn't change :-( – leetbacoon Mar 18 '19 at 17:47
  • Did you disconnect from the samba server and reconnect after adding the two lines? – Morbius1 Mar 18 '19 at 20:00
  • Oops, forgot to do that. It works nice now, however when moving a file over that is -rwxrwxrwx it changes it to -rw-rwxrwx – leetbacoon Mar 19 '19 at 1:34
  • 1
    I added another line in my post that you need to add to the [SMB Share] share definition in smb.conf. Remember to restart smbd and disconnect and reconnect to the server in Finder. – Morbius1 Mar 20 '19 at 10:46
  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960 – leetbacoon Mar 21 '19 at 6:10

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.