Make subdirectory world writable even if parent folder is not

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0














i have a folder called Public inside my home folder. I need to share this folder (write only) via samba. However if i chmod 772 Public it doesn't work since my home folder is 750. Is there a way to solve this without chmod 777 my home folder?










share|improve this question























  • probably a symlink will do it.
    – mikeserv
    Jan 6 '16 at 15:48






  • 4




    You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
    – Eric Renouf
    Jan 6 '16 at 15:50






  • 1




    Consider: unix.stackexchange.com/questions/21251/…
    – Eric Renouf
    Jan 6 '16 at 15:51










  • you could chmod 755 /home/yourname
    – John Militer
    Apr 24 '16 at 22:29















0














i have a folder called Public inside my home folder. I need to share this folder (write only) via samba. However if i chmod 772 Public it doesn't work since my home folder is 750. Is there a way to solve this without chmod 777 my home folder?










share|improve this question























  • probably a symlink will do it.
    – mikeserv
    Jan 6 '16 at 15:48






  • 4




    You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
    – Eric Renouf
    Jan 6 '16 at 15:50






  • 1




    Consider: unix.stackexchange.com/questions/21251/…
    – Eric Renouf
    Jan 6 '16 at 15:51










  • you could chmod 755 /home/yourname
    – John Militer
    Apr 24 '16 at 22:29













0












0








0







i have a folder called Public inside my home folder. I need to share this folder (write only) via samba. However if i chmod 772 Public it doesn't work since my home folder is 750. Is there a way to solve this without chmod 777 my home folder?










share|improve this question















i have a folder called Public inside my home folder. I need to share this folder (write only) via samba. However if i chmod 772 Public it doesn't work since my home folder is 750. Is there a way to solve this without chmod 777 my home folder?







permissions samba shared-folders






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 20 '18 at 7:27









Rui F Ribeiro

39k1479130




39k1479130










asked Jan 6 '16 at 15:43









Matteo

3051513




3051513











  • probably a symlink will do it.
    – mikeserv
    Jan 6 '16 at 15:48






  • 4




    You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
    – Eric Renouf
    Jan 6 '16 at 15:50






  • 1




    Consider: unix.stackexchange.com/questions/21251/…
    – Eric Renouf
    Jan 6 '16 at 15:51










  • you could chmod 755 /home/yourname
    – John Militer
    Apr 24 '16 at 22:29
















  • probably a symlink will do it.
    – mikeserv
    Jan 6 '16 at 15:48






  • 4




    You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
    – Eric Renouf
    Jan 6 '16 at 15:50






  • 1




    Consider: unix.stackexchange.com/questions/21251/…
    – Eric Renouf
    Jan 6 '16 at 15:51










  • you could chmod 755 /home/yourname
    – John Militer
    Apr 24 '16 at 22:29















probably a symlink will do it.
– mikeserv
Jan 6 '16 at 15:48




probably a symlink will do it.
– mikeserv
Jan 6 '16 at 15:48




4




4




You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
– Eric Renouf
Jan 6 '16 at 15:50




You must add the execute priv to your home dir so it can be used in other paths. They don't need read or write, just x
– Eric Renouf
Jan 6 '16 at 15:50




1




1




Consider: unix.stackexchange.com/questions/21251/…
– Eric Renouf
Jan 6 '16 at 15:51




Consider: unix.stackexchange.com/questions/21251/…
– Eric Renouf
Jan 6 '16 at 15:51












you could chmod 755 /home/yourname
– John Militer
Apr 24 '16 at 22:29




you could chmod 755 /home/yourname
– John Militer
Apr 24 '16 at 22:29










2 Answers
2






active

oldest

votes


















0














You could use the force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.



Without knowing the details of your requirement there's little point suggesting more complex alternatives.






share|improve this answer




















  • Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
    – Kusalananda
    Dec 20 '18 at 9:11










  • @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
    – roaima
    Dec 20 '18 at 11:46


















0














To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless r was also in effect).



For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be wx, and all parent directories should have at least x.



If you are creating a "drop box" in your home directory, therefore:



cd
mkdir directory
chmod o=wx,g=wx directory
chmod a+x "$HOME"


Note that I'm also giving the group wx access to the directory here (rather than using g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though o=wx was in effect.



Assuming you as the owner has rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.






share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    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: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    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%2funix.stackexchange.com%2fquestions%2f253646%2fmake-subdirectory-world-writable-even-if-parent-folder-is-not%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You could use the force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.



    Without knowing the details of your requirement there's little point suggesting more complex alternatives.






    share|improve this answer




















    • Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
      – Kusalananda
      Dec 20 '18 at 9:11










    • @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
      – roaima
      Dec 20 '18 at 11:46















    0














    You could use the force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.



    Without knowing the details of your requirement there's little point suggesting more complex alternatives.






    share|improve this answer




















    • Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
      – Kusalananda
      Dec 20 '18 at 9:11










    • @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
      – roaima
      Dec 20 '18 at 11:46













    0












    0








    0






    You could use the force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.



    Without knowing the details of your requirement there's little point suggesting more complex alternatives.






    share|improve this answer












    You could use the force user directive on the SAMBA share definition to ensure all network access is made as your user account. The missing "other" permissions on the parent directory then become irrelevant.



    Without knowing the details of your requirement there's little point suggesting more complex alternatives.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 20 '18 at 7:56









    roaima

    42.8k551116




    42.8k551116











    • Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
      – Kusalananda
      Dec 20 '18 at 9:11










    • @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
      – roaima
      Dec 20 '18 at 11:46
















    • Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
      – Kusalananda
      Dec 20 '18 at 9:11










    • @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
      – roaima
      Dec 20 '18 at 11:46















    Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
    – Kusalananda
    Dec 20 '18 at 9:11




    Hmm... This would mean that all new files were owned by the account, not by the users creating the files. It would also mean that access permissions on individual files and subdirectories would become (more or less) ineffective.
    – Kusalananda
    Dec 20 '18 at 9:11












    @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
    – roaima
    Dec 20 '18 at 11:46




    @Kusalananda without details of what the OP wants it's as good a suggestion as any. UNIX style permissions and SAMBA permissions often don't cleanly intersect (well, not intuitively).
    – roaima
    Dec 20 '18 at 11:46













    0














    To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless r was also in effect).



    For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be wx, and all parent directories should have at least x.



    If you are creating a "drop box" in your home directory, therefore:



    cd
    mkdir directory
    chmod o=wx,g=wx directory
    chmod a+x "$HOME"


    Note that I'm also giving the group wx access to the directory here (rather than using g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though o=wx was in effect.



    Assuming you as the owner has rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.






    share|improve this answer

























      0














      To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless r was also in effect).



      For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be wx, and all parent directories should have at least x.



      If you are creating a "drop box" in your home directory, therefore:



      cd
      mkdir directory
      chmod o=wx,g=wx directory
      chmod a+x "$HOME"


      Note that I'm also giving the group wx access to the directory here (rather than using g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though o=wx was in effect.



      Assuming you as the owner has rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.






      share|improve this answer























        0












        0








        0






        To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless r was also in effect).



        For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be wx, and all parent directories should have at least x.



        If you are creating a "drop box" in your home directory, therefore:



        cd
        mkdir directory
        chmod o=wx,g=wx directory
        chmod a+x "$HOME"


        Note that I'm also giving the group wx access to the directory here (rather than using g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though o=wx was in effect.



        Assuming you as the owner has rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.






        share|improve this answer












        To access a directory, the directory itself, as well as all the intermediate directories from the root down, has to have the x permission for the given user, their group or all. This would allow reading files in the directory if one knew their pathnames (listing the contents of the directory would not be allowed unless r was also in effect).



        For a world-write-only directory ("write" meaning "permitting the creation and deletion of files and subdirectories, and updating their metadata"), the permissions on the directory itself should be wx, and all parent directories should have at least x.



        If you are creating a "drop box" in your home directory, therefore:



        cd
        mkdir directory
        chmod o=wx,g=wx directory
        chmod a+x "$HOME"


        Note that I'm also giving the group wx access to the directory here (rather than using g=). A member of the group who owns the directory (probably your primary group) would otherwise be explicitly denied access to the directory even though o=wx was in effect.



        Assuming you as the owner has rwx permissions to the directory, this is equivalent to the octal permissions 0733 on the "drop box" directory.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 20 '18 at 8:25









        Kusalananda

        121k16229372




        121k16229372



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


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





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2funix.stackexchange.com%2fquestions%2f253646%2fmake-subdirectory-world-writable-even-if-parent-folder-is-not%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 to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay