Why is my “appuser” not allowed to read an apche2 log although the user has group adm?

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








up vote
1
down vote

favorite












I already found some solutions here: AWStats: cannot access /var/log/apache2/access.log, but this are "hammer-methods", like change ownership and so on. I do not like.



I want to understand what is going on (probably then I use one of this hammers)



What is the scenario: I have an user "myapp" (in my case the user my rails app uses)



myapp@myapp-pre ~/appdir$ id
uid=1000(myapp) gid=100(users) groups=100(users),4(adm),27(sudo)


As you can see the user has group "adm". Lets take a look at the log file



myapp@myapp-pre ~/appdir$ sudo ls -l /var/log/apache2/error.log
-rw-r----- 1 root adm 17503 Apr 28 17:05 /var/log/apache2/error.log


Here we see, that error.log belongs to root:adm - root(rw) - adm(r)



But not "sodoed":



myapp@myapp-pre ~/appdir$ ls -l /var/log/apache2/error.log
ls: cannot access /var/log/apache2/error.log: Permission denied


If I take a look at the parent directory:



myapp@myapp-pre ~/appdir$ ls -l /var/log



...
-rw-r--r-- 1 root root 347 May 26 2017 alternatives.log.7.gz
-rw-r--r-- 1 root root 419 Mar 14 2017 alternatives.log.8.gz
-rw-r--r-- 1 root root 369 Feb 14 2017 alternatives.log.9.gz
dr-xr--r-T 2 root adm 4096 Apr 28 06:05 apache2
-rw-r----- 1 root adm 4013282 Apr 28 17:22 auth.log
-rw-r----- 1 root adm 4467467 Apr 23 06:05 auth.log.1
-rw-r----- 1 root adm 269469 Apr 15 06:05 auth.log.2.gz
...


I see, that many files have the same root:adm permissions, and user myapp can read them.



A try just to read the file



myapp@myapp-pre ~/appdir$ cat /var/log/apache2/error.log
cat: /var/log/apache2/error.log: Permission denied


same result ...



So why is my user "myapp" not allowed to read?







share|improve this question
























    up vote
    1
    down vote

    favorite












    I already found some solutions here: AWStats: cannot access /var/log/apache2/access.log, but this are "hammer-methods", like change ownership and so on. I do not like.



    I want to understand what is going on (probably then I use one of this hammers)



    What is the scenario: I have an user "myapp" (in my case the user my rails app uses)



    myapp@myapp-pre ~/appdir$ id
    uid=1000(myapp) gid=100(users) groups=100(users),4(adm),27(sudo)


    As you can see the user has group "adm". Lets take a look at the log file



    myapp@myapp-pre ~/appdir$ sudo ls -l /var/log/apache2/error.log
    -rw-r----- 1 root adm 17503 Apr 28 17:05 /var/log/apache2/error.log


    Here we see, that error.log belongs to root:adm - root(rw) - adm(r)



    But not "sodoed":



    myapp@myapp-pre ~/appdir$ ls -l /var/log/apache2/error.log
    ls: cannot access /var/log/apache2/error.log: Permission denied


    If I take a look at the parent directory:



    myapp@myapp-pre ~/appdir$ ls -l /var/log



    ...
    -rw-r--r-- 1 root root 347 May 26 2017 alternatives.log.7.gz
    -rw-r--r-- 1 root root 419 Mar 14 2017 alternatives.log.8.gz
    -rw-r--r-- 1 root root 369 Feb 14 2017 alternatives.log.9.gz
    dr-xr--r-T 2 root adm 4096 Apr 28 06:05 apache2
    -rw-r----- 1 root adm 4013282 Apr 28 17:22 auth.log
    -rw-r----- 1 root adm 4467467 Apr 23 06:05 auth.log.1
    -rw-r----- 1 root adm 269469 Apr 15 06:05 auth.log.2.gz
    ...


    I see, that many files have the same root:adm permissions, and user myapp can read them.



    A try just to read the file



    myapp@myapp-pre ~/appdir$ cat /var/log/apache2/error.log
    cat: /var/log/apache2/error.log: Permission denied


    same result ...



    So why is my user "myapp" not allowed to read?







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I already found some solutions here: AWStats: cannot access /var/log/apache2/access.log, but this are "hammer-methods", like change ownership and so on. I do not like.



      I want to understand what is going on (probably then I use one of this hammers)



      What is the scenario: I have an user "myapp" (in my case the user my rails app uses)



      myapp@myapp-pre ~/appdir$ id
      uid=1000(myapp) gid=100(users) groups=100(users),4(adm),27(sudo)


      As you can see the user has group "adm". Lets take a look at the log file



      myapp@myapp-pre ~/appdir$ sudo ls -l /var/log/apache2/error.log
      -rw-r----- 1 root adm 17503 Apr 28 17:05 /var/log/apache2/error.log


      Here we see, that error.log belongs to root:adm - root(rw) - adm(r)



      But not "sodoed":



      myapp@myapp-pre ~/appdir$ ls -l /var/log/apache2/error.log
      ls: cannot access /var/log/apache2/error.log: Permission denied


      If I take a look at the parent directory:



      myapp@myapp-pre ~/appdir$ ls -l /var/log



      ...
      -rw-r--r-- 1 root root 347 May 26 2017 alternatives.log.7.gz
      -rw-r--r-- 1 root root 419 Mar 14 2017 alternatives.log.8.gz
      -rw-r--r-- 1 root root 369 Feb 14 2017 alternatives.log.9.gz
      dr-xr--r-T 2 root adm 4096 Apr 28 06:05 apache2
      -rw-r----- 1 root adm 4013282 Apr 28 17:22 auth.log
      -rw-r----- 1 root adm 4467467 Apr 23 06:05 auth.log.1
      -rw-r----- 1 root adm 269469 Apr 15 06:05 auth.log.2.gz
      ...


      I see, that many files have the same root:adm permissions, and user myapp can read them.



      A try just to read the file



      myapp@myapp-pre ~/appdir$ cat /var/log/apache2/error.log
      cat: /var/log/apache2/error.log: Permission denied


      same result ...



      So why is my user "myapp" not allowed to read?







      share|improve this question












      I already found some solutions here: AWStats: cannot access /var/log/apache2/access.log, but this are "hammer-methods", like change ownership and so on. I do not like.



      I want to understand what is going on (probably then I use one of this hammers)



      What is the scenario: I have an user "myapp" (in my case the user my rails app uses)



      myapp@myapp-pre ~/appdir$ id
      uid=1000(myapp) gid=100(users) groups=100(users),4(adm),27(sudo)


      As you can see the user has group "adm". Lets take a look at the log file



      myapp@myapp-pre ~/appdir$ sudo ls -l /var/log/apache2/error.log
      -rw-r----- 1 root adm 17503 Apr 28 17:05 /var/log/apache2/error.log


      Here we see, that error.log belongs to root:adm - root(rw) - adm(r)



      But not "sodoed":



      myapp@myapp-pre ~/appdir$ ls -l /var/log/apache2/error.log
      ls: cannot access /var/log/apache2/error.log: Permission denied


      If I take a look at the parent directory:



      myapp@myapp-pre ~/appdir$ ls -l /var/log



      ...
      -rw-r--r-- 1 root root 347 May 26 2017 alternatives.log.7.gz
      -rw-r--r-- 1 root root 419 Mar 14 2017 alternatives.log.8.gz
      -rw-r--r-- 1 root root 369 Feb 14 2017 alternatives.log.9.gz
      dr-xr--r-T 2 root adm 4096 Apr 28 06:05 apache2
      -rw-r----- 1 root adm 4013282 Apr 28 17:22 auth.log
      -rw-r----- 1 root adm 4467467 Apr 23 06:05 auth.log.1
      -rw-r----- 1 root adm 269469 Apr 15 06:05 auth.log.2.gz
      ...


      I see, that many files have the same root:adm permissions, and user myapp can read them.



      A try just to read the file



      myapp@myapp-pre ~/appdir$ cat /var/log/apache2/error.log
      cat: /var/log/apache2/error.log: Permission denied


      same result ...



      So why is my user "myapp" not allowed to read?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 28 at 14:54









      halfbit

      1063




      1063

























          active

          oldest

          votes











          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',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f1029268%2fwhy-is-my-appuser-not-allowed-to-read-an-apche2-log-although-the-user-has-grou%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1029268%2fwhy-is-my-appuser-not-allowed-to-read-an-apche2-log-although-the-user-has-grou%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

          Trouble downloading packages list due to a “Hash sum mismatch” error

          How do I move numbers in filenames, in a batch renaming operation?