Give 2 users folder permissions only works periodicallyDefault file permissions for php user www-dataHow do I set the permissions for newly created files?Add www-data to alternate groupHow to setup Restricted (permission) access for Directories in Apache2 web serverMoving and deleting files in setguid foldersOwnCloud: Permission denied for www-data on mounted driveIssue with folder permissionsCannot stat 'direction', permission denied when permission's are setisc_stdio_open '/var/log/bind9/query.log' failed: permission deniedCertain git commands (diff, log) require sudo priviledges

You may need me after too many

paying debt collector's invalid rent claim, then suing landlord for money back

Is there a name for the phenomenon of false positives counterintuitively outstripping true positives

Wood glue versus epoxy for doweling stripped screw holes

What would you do? Different results than what is reported

Palindrome and Reverse a String Problems (JavaScript, Python)

Why is Microwaved mac & cheese burnt where they touch?

Why is a 737 Original speed-restricted below 10,000 ft with inoperative windscreen heating?

Knights covering a 9x9 chess board

Is the EU Settlement Scheme legal?

How to delete music as it's being played

prevent add-on being enabled in lower Blender version than 2.8

Increase size of square brackets

Phrase: the sun is out

Articles at the beginning of sentences in scientific writing

529 accounts for multiple kids

Find the closest enemy

I love fishing, dancing, playing, crafting, and fighting

How do Italians make a statement a question?

Do I need a visa for Japan as a New Zealand Citizen?

What kind of mathematical disciplines would be most useful for physics?

Length-terminated sequences

How to get previous command without arrow key

Endless disc brake issues



Give 2 users folder permissions only works periodically


Default file permissions for php user www-dataHow do I set the permissions for newly created files?Add www-data to alternate groupHow to setup Restricted (permission) access for Directories in Apache2 web serverMoving and deleting files in setguid foldersOwnCloud: Permission denied for www-data on mounted driveIssue with folder permissionsCannot stat 'direction', permission denied when permission's are setisc_stdio_open '/var/log/bind9/query.log' failed: permission deniedCertain git commands (diff, log) require sudo priviledges






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









0

















I have a weird issue with folder permissions on my ubuntu server.



I have 2 users which need access to nginx logs, www-data (nginx) and dd-agent (datadog, a logging service).



I created a group logusers and added both users to that group, then I changed permissions as follows:



sudo chown -R dd-agent:logusers /var/log/nginx/



I can see the following for ls -l:




drwxr-xr-x 2 dd-agent logusers 4096 May 29 06:25 nginx




Then I check both the status of the dd-service and nginx-service, and both are fine, but after a couple of hours, datadog reports a permission denied error for opening a file inside /var/log/nginx/.



How can I make sure both users have proper access? Why does this change over time?



--Edit:
Restarting the datadog-agent service and checking its status again shows no permission errors. This is weird.










share|improve this question























  • 2





    has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

    – AlexOnLinux
    May 29 at 7:18











  • I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

    – mook765
    May 29 at 7:20






  • 1





    @AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

    – ffritz
    May 29 at 7:28











  • Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

    – mook765
    May 29 at 7:28











  • @mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

    – ffritz
    May 29 at 9:01

















0

















I have a weird issue with folder permissions on my ubuntu server.



I have 2 users which need access to nginx logs, www-data (nginx) and dd-agent (datadog, a logging service).



I created a group logusers and added both users to that group, then I changed permissions as follows:



sudo chown -R dd-agent:logusers /var/log/nginx/



I can see the following for ls -l:




drwxr-xr-x 2 dd-agent logusers 4096 May 29 06:25 nginx




Then I check both the status of the dd-service and nginx-service, and both are fine, but after a couple of hours, datadog reports a permission denied error for opening a file inside /var/log/nginx/.



How can I make sure both users have proper access? Why does this change over time?



--Edit:
Restarting the datadog-agent service and checking its status again shows no permission errors. This is weird.










share|improve this question























  • 2





    has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

    – AlexOnLinux
    May 29 at 7:18











  • I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

    – mook765
    May 29 at 7:20






  • 1





    @AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

    – ffritz
    May 29 at 7:28











  • Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

    – mook765
    May 29 at 7:28











  • @mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

    – ffritz
    May 29 at 9:01













0












0








0








I have a weird issue with folder permissions on my ubuntu server.



I have 2 users which need access to nginx logs, www-data (nginx) and dd-agent (datadog, a logging service).



I created a group logusers and added both users to that group, then I changed permissions as follows:



sudo chown -R dd-agent:logusers /var/log/nginx/



I can see the following for ls -l:




drwxr-xr-x 2 dd-agent logusers 4096 May 29 06:25 nginx




Then I check both the status of the dd-service and nginx-service, and both are fine, but after a couple of hours, datadog reports a permission denied error for opening a file inside /var/log/nginx/.



How can I make sure both users have proper access? Why does this change over time?



--Edit:
Restarting the datadog-agent service and checking its status again shows no permission errors. This is weird.










share|improve this question

















I have a weird issue with folder permissions on my ubuntu server.



I have 2 users which need access to nginx logs, www-data (nginx) and dd-agent (datadog, a logging service).



I created a group logusers and added both users to that group, then I changed permissions as follows:



sudo chown -R dd-agent:logusers /var/log/nginx/



I can see the following for ls -l:




drwxr-xr-x 2 dd-agent logusers 4096 May 29 06:25 nginx




Then I check both the status of the dd-service and nginx-service, and both are fine, but after a couple of hours, datadog reports a permission denied error for opening a file inside /var/log/nginx/.



How can I make sure both users have proper access? Why does this change over time?



--Edit:
Restarting the datadog-agent service and checking its status again shows no permission errors. This is weird.







server 18.04 permissions






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited May 29 at 7:16







ffritz

















asked May 29 at 7:10









ffritzffritz

1012 bronze badges




1012 bronze badges










  • 2





    has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

    – AlexOnLinux
    May 29 at 7:18











  • I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

    – mook765
    May 29 at 7:20






  • 1





    @AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

    – ffritz
    May 29 at 7:28











  • Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

    – mook765
    May 29 at 7:28











  • @mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

    – ffritz
    May 29 at 9:01












  • 2





    has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

    – AlexOnLinux
    May 29 at 7:18











  • I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

    – mook765
    May 29 at 7:20






  • 1





    @AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

    – ffritz
    May 29 at 7:28











  • Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

    – mook765
    May 29 at 7:28











  • @mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

    – ffritz
    May 29 at 9:01







2




2





has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

– AlexOnLinux
May 29 at 7:18





has that file been newly created, probably with different rights? have you checked ls -la /var/log/nginx/specific-file

– AlexOnLinux
May 29 at 7:18













I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

– mook765
May 29 at 7:20





I don't understand why you create a new group to do that. Why don't you add the users to the www-data and dd-agent groups?

– mook765
May 29 at 7:20




1




1





@AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

– ffritz
May 29 at 7:28





@AlexOnLinux Indeed is has been. -rw-r----- 1 dd-agent logusers 118883 May 29 09:25 access.log

– ffritz
May 29 at 7:28













Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

– mook765
May 29 at 7:28





Also remind : newly created files in /var/log/nginx/ (after the chown-command) will not be associated with the grouplogusers.

– mook765
May 29 at 7:28













@mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

– ffritz
May 29 at 9:01





@mook765 So sudo usermod -a -G www-data dd-agent and sudo chown -R www-data:www-data /var/log/nginx/ should do it right?

– ffritz
May 29 at 9:01










1 Answer
1






active

oldest

votes


















0


















if you want your new created files to be created as the group you specified to the folder you could do the following



sudo chmod g+s /var/log/nginx/


this will set the SGID-Bit ( Set Group ID ) to the folder with the result that every new created file inside that folder will inherit the group of the folder.






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/4.0/"u003ecc by-sa 4.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%2f1147029%2fgive-2-users-folder-permissions-only-works-periodically%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









    0


















    if you want your new created files to be created as the group you specified to the folder you could do the following



    sudo chmod g+s /var/log/nginx/


    this will set the SGID-Bit ( Set Group ID ) to the folder with the result that every new created file inside that folder will inherit the group of the folder.






    share|improve this answer






























      0


















      if you want your new created files to be created as the group you specified to the folder you could do the following



      sudo chmod g+s /var/log/nginx/


      this will set the SGID-Bit ( Set Group ID ) to the folder with the result that every new created file inside that folder will inherit the group of the folder.






      share|improve this answer




























        0














        0










        0









        if you want your new created files to be created as the group you specified to the folder you could do the following



        sudo chmod g+s /var/log/nginx/


        this will set the SGID-Bit ( Set Group ID ) to the folder with the result that every new created file inside that folder will inherit the group of the folder.






        share|improve this answer














        if you want your new created files to be created as the group you specified to the folder you could do the following



        sudo chmod g+s /var/log/nginx/


        this will set the SGID-Bit ( Set Group ID ) to the folder with the result that every new created file inside that folder will inherit the group of the folder.







        share|improve this answer













        share|improve this answer




        share|improve this answer










        answered May 29 at 9:00









        AlexOnLinuxAlexOnLinux

        6023 silver badges14 bronze badges




        6023 silver badges14 bronze badges































            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%2f1147029%2fgive-2-users-folder-permissions-only-works-periodically%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

            Tamil (spriik) Luke uk diar | Nawigatjuun

            Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

            Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?