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

Clash 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?
permissions
add a comment |Â
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?
permissions
add a comment |Â
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?
permissions
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?
permissions
asked Apr 28 at 14:54
halfbit
1063
1063
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password