Giving a single user write permissions












6















I want to grant a single user write permissions to a directory owned by root over command line. With chmod, it seems that I can only change the permissions for owner, group and other, not for a specific user.










share|improve this question



























    6















    I want to grant a single user write permissions to a directory owned by root over command line. With chmod, it seems that I can only change the permissions for owner, group and other, not for a specific user.










    share|improve this question

























      6












      6








      6








      I want to grant a single user write permissions to a directory owned by root over command line. With chmod, it seems that I can only change the permissions for owner, group and other, not for a specific user.










      share|improve this question














      I want to grant a single user write permissions to a directory owned by root over command line. With chmod, it seems that I can only change the permissions for owner, group and other, not for a specific user.







      permissions users






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 24 '11 at 22:22









      HanneshHannesh

      13313




      13313






















          2 Answers
          2






          active

          oldest

          votes


















          6














          If filesystem is mounted with the acl option (default in ext4 in any modern Ubuntu - if not, add it to /etc/fstab), you can use setfacl:



          setfacl -m u:USERNAME:r FILENAME


          would give user USERNAME read access to FILENAME.






          share|improve this answer


























          • Remember to install acl package.

            – enzotib
            Sep 25 '11 at 8:43



















          1














          By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.



          You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.



          Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.






          share|improve this answer























            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%2f62868%2fgiving-a-single-user-write-permissions%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









            6














            If filesystem is mounted with the acl option (default in ext4 in any modern Ubuntu - if not, add it to /etc/fstab), you can use setfacl:



            setfacl -m u:USERNAME:r FILENAME


            would give user USERNAME read access to FILENAME.






            share|improve this answer


























            • Remember to install acl package.

              – enzotib
              Sep 25 '11 at 8:43
















            6














            If filesystem is mounted with the acl option (default in ext4 in any modern Ubuntu - if not, add it to /etc/fstab), you can use setfacl:



            setfacl -m u:USERNAME:r FILENAME


            would give user USERNAME read access to FILENAME.






            share|improve this answer


























            • Remember to install acl package.

              – enzotib
              Sep 25 '11 at 8:43














            6












            6








            6







            If filesystem is mounted with the acl option (default in ext4 in any modern Ubuntu - if not, add it to /etc/fstab), you can use setfacl:



            setfacl -m u:USERNAME:r FILENAME


            would give user USERNAME read access to FILENAME.






            share|improve this answer















            If filesystem is mounted with the acl option (default in ext4 in any modern Ubuntu - if not, add it to /etc/fstab), you can use setfacl:



            setfacl -m u:USERNAME:r FILENAME


            would give user USERNAME read access to FILENAME.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 22 at 12:43









            Olorin

            2,433822




            2,433822










            answered Sep 25 '11 at 6:25









            Kees CookKees Cook

            13.9k75791




            13.9k75791













            • Remember to install acl package.

              – enzotib
              Sep 25 '11 at 8:43



















            • Remember to install acl package.

              – enzotib
              Sep 25 '11 at 8:43

















            Remember to install acl package.

            – enzotib
            Sep 25 '11 at 8:43





            Remember to install acl package.

            – enzotib
            Sep 25 '11 at 8:43













            1














            By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.



            You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.



            Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.






            share|improve this answer




























              1














              By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.



              You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.



              Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.






              share|improve this answer


























                1












                1








                1







                By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.



                You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.



                Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.






                share|improve this answer













                By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.



                You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.



                Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 24 '11 at 22:54









                SergeySergey

                36.5k98799




                36.5k98799






























                    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%2f62868%2fgiving-a-single-user-write-permissions%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

                    Human spaceflight

                    Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                    張江高科駅