Preserve Permissions when adding files to a Samba share












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.










share|improve this question























  • @Podesta tried that and the file it did it again, turned the file into -rwx------

    – leetbacoon
    Mar 17 at 6:55











  • even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

    – leetbacoon
    Mar 17 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 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 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 at 0:27
















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.










share|improve this question























  • @Podesta tried that and the file it did it again, turned the file into -rwx------

    – leetbacoon
    Mar 17 at 6:55











  • even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

    – leetbacoon
    Mar 17 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 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 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 at 0:27














0












0








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.










share|improve this question














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.







permissions samba mac zfs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 17 at 1:24









leetbacoonleetbacoon

84119




84119













  • @Podesta tried that and the file it did it again, turned the file into -rwx------

    – leetbacoon
    Mar 17 at 6:55











  • even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

    – leetbacoon
    Mar 17 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 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 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 at 0:27



















  • @Podesta tried that and the file it did it again, turned the file into -rwx------

    – leetbacoon
    Mar 17 at 6:55











  • even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

    – leetbacoon
    Mar 17 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 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 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 at 0:27

















@Podesta tried that and the file it did it again, turned the file into -rwx------

– leetbacoon
Mar 17 at 6:55





@Podesta tried that and the file it did it again, turned the file into -rwx------

– leetbacoon
Mar 17 at 6:55













even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

– leetbacoon
Mar 17 at 6:57





even just to test, tried chmod 777 /Volumes/SMB Share/foo.txt and still only gave me -rwx------

– leetbacoon
Mar 17 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 at 16:47







@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 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 at 16:58





@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 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 at 0:27





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 at 0:27










1 Answer
1






active

oldest

votes


















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





share|improve this answer


























  • Thank you, but it didn't change :-(

    – leetbacoon
    Mar 18 at 17:47











  • Did you disconnect from the samba server and reconnect after adding the two lines?

    – Morbius1
    Mar 18 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 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 at 10:46











  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

    – leetbacoon
    Mar 21 at 6:10













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1126293%2fpreserve-permissions-when-adding-files-to-a-samba-share%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









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





share|improve this answer


























  • Thank you, but it didn't change :-(

    – leetbacoon
    Mar 18 at 17:47











  • Did you disconnect from the samba server and reconnect after adding the two lines?

    – Morbius1
    Mar 18 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 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 at 10:46











  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

    – leetbacoon
    Mar 21 at 6:10


















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





share|improve this answer


























  • Thank you, but it didn't change :-(

    – leetbacoon
    Mar 18 at 17:47











  • Did you disconnect from the samba server and reconnect after adding the two lines?

    – Morbius1
    Mar 18 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 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 at 10:46











  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

    – leetbacoon
    Mar 21 at 6:10
















1












1








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





share|improve this answer















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






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 20 at 10:45

























answered Mar 18 at 14:17









Morbius1Morbius1

1,561138




1,561138













  • Thank you, but it didn't change :-(

    – leetbacoon
    Mar 18 at 17:47











  • Did you disconnect from the samba server and reconnect after adding the two lines?

    – Morbius1
    Mar 18 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 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 at 10:46











  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

    – leetbacoon
    Mar 21 at 6:10





















  • Thank you, but it didn't change :-(

    – leetbacoon
    Mar 18 at 17:47











  • Did you disconnect from the samba server and reconnect after adding the two lines?

    – Morbius1
    Mar 18 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 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 at 10:46











  • Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

    – leetbacoon
    Mar 21 at 6:10



















Thank you, but it didn't change :-(

– leetbacoon
Mar 18 at 17:47





Thank you, but it didn't change :-(

– leetbacoon
Mar 18 at 17:47













Did you disconnect from the samba server and reconnect after adding the two lines?

– Morbius1
Mar 18 at 20:00





Did you disconnect from the samba server and reconnect after adding the two lines?

– Morbius1
Mar 18 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 at 1:34







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 at 1:34






1




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 at 10:46





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 at 10:46













Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

– leetbacoon
Mar 21 at 6:10







Working beautifully, thank you very much! Morbius also discussed this here: ubuntuforums.org/showthread.php?t=2414960

– leetbacoon
Mar 21 at 6:10




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1126293%2fpreserve-permissions-when-adding-files-to-a-samba-share%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局