Getting âPermission deniedâ even though I have set global read permissions on a file

Clash Royale CLAN TAG#URR8PPP
up vote
-2
down vote
favorite
I'm using Amazon Linux. I have set global read permissions on a file, but I can't seem to access it as a normal user:
[myuser@mymachine ~]$ ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
ls: cannot access /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css: Permission denied
[myuser@mymachine ~]$ sudo ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
-rwxrwxr-x 1 jboss jboss 771 Oct 29 18:51 /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
[myuser@mymachine ~]$ whoami
myuser
Notice that when I run "sudo" I am able to access it. I would like to keep the file owned by the jboss user. How can I get the file accessible to my (or anyone else's user) in read mode?
permissions users chmod cgroups access-control
add a comment |Â
up vote
-2
down vote
favorite
I'm using Amazon Linux. I have set global read permissions on a file, but I can't seem to access it as a normal user:
[myuser@mymachine ~]$ ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
ls: cannot access /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css: Permission denied
[myuser@mymachine ~]$ sudo ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
-rwxrwxr-x 1 jboss jboss 771 Oct 29 18:51 /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
[myuser@mymachine ~]$ whoami
myuser
Notice that when I run "sudo" I am able to access it. I would like to keep the file owned by the jboss user. How can I get the file accessible to my (or anyone else's user) in read mode?
permissions users chmod cgroups access-control
2
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45
add a comment |Â
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
I'm using Amazon Linux. I have set global read permissions on a file, but I can't seem to access it as a normal user:
[myuser@mymachine ~]$ ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
ls: cannot access /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css: Permission denied
[myuser@mymachine ~]$ sudo ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
-rwxrwxr-x 1 jboss jboss 771 Oct 29 18:51 /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
[myuser@mymachine ~]$ whoami
myuser
Notice that when I run "sudo" I am able to access it. I would like to keep the file owned by the jboss user. How can I get the file accessible to my (or anyone else's user) in read mode?
permissions users chmod cgroups access-control
I'm using Amazon Linux. I have set global read permissions on a file, but I can't seem to access it as a normal user:
[myuser@mymachine ~]$ ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
ls: cannot access /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css: Permission denied
[myuser@mymachine ~]$ sudo ls -al /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
-rwxrwxr-x 1 jboss jboss 771 Oct 29 18:51 /usr/java/jboss/standalone/deployments/myproject.war/css/reset.css
[myuser@mymachine ~]$ whoami
myuser
Notice that when I run "sudo" I am able to access it. I would like to keep the file owned by the jboss user. How can I get the file accessible to my (or anyone else's user) in read mode?
permissions users chmod cgroups access-control
edited Dec 7 '17 at 16:10
peterh
3,94592755
3,94592755
asked Dec 7 '17 at 15:38
Dave
368827
368827
2
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45
add a comment |Â
2
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45
2
2
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
You need to check permissions of each element in the path, not just the file permissions. Each directory must have access 'x' (which means execute for files but traverse for directories) for the user wishing to run the command.
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start byls -al /usrthenls -al /usr/javaand so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see commandlsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.
â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results betweenlsandls -l, see unix.stackexchange.com/a/150456/211833
â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
Forls -l, yes.
â Patrick Mevzek
Dec 7 '17 at 16:21
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
You need to check permissions of each element in the path, not just the file permissions. Each directory must have access 'x' (which means execute for files but traverse for directories) for the user wishing to run the command.
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start byls -al /usrthenls -al /usr/javaand so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see commandlsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.
â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results betweenlsandls -l, see unix.stackexchange.com/a/150456/211833
â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
Forls -l, yes.
â Patrick Mevzek
Dec 7 '17 at 16:21
 |Â
show 1 more comment
up vote
7
down vote
accepted
You need to check permissions of each element in the path, not just the file permissions. Each directory must have access 'x' (which means execute for files but traverse for directories) for the user wishing to run the command.
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start byls -al /usrthenls -al /usr/javaand so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see commandlsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.
â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results betweenlsandls -l, see unix.stackexchange.com/a/150456/211833
â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
Forls -l, yes.
â Patrick Mevzek
Dec 7 '17 at 16:21
 |Â
show 1 more comment
up vote
7
down vote
accepted
up vote
7
down vote
accepted
You need to check permissions of each element in the path, not just the file permissions. Each directory must have access 'x' (which means execute for files but traverse for directories) for the user wishing to run the command.
You need to check permissions of each element in the path, not just the file permissions. Each directory must have access 'x' (which means execute for files but traverse for directories) for the user wishing to run the command.
answered Dec 7 '17 at 15:41
Patrick Mevzek
2,0381721
2,0381721
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start byls -al /usrthenls -al /usr/javaand so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see commandlsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.
â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results betweenlsandls -l, see unix.stackexchange.com/a/150456/211833
â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
Forls -l, yes.
â Patrick Mevzek
Dec 7 '17 at 16:21
 |Â
show 1 more comment
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start byls -al /usrthenls -al /usr/javaand so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see commandlsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.
â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results betweenlsandls -l, see unix.stackexchange.com/a/150456/211833
â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
Forls -l, yes.
â Patrick Mevzek
Dec 7 '17 at 16:21
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
What if every directory on the path has the "r" permission set for everyone? Is there any other behavior that would explain what I'm seeing?
â Dave
Dec 7 '17 at 15:55
You can try "sequentially". Start by
ls -al /usr then ls -al /usr/java and so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see command lsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.â Patrick Mevzek
Dec 7 '17 at 16:02
You can try "sequentially". Start by
ls -al /usr then ls -al /usr/java and so on, to find where you have problems. You can have "extended ACLs" on some component of the path (see command lsattr) and even some specific to the filesystem you use, but this is far less likely than a pure base problem of read/execute rights missing. So first try component by component to pinpoint the problem.â Patrick Mevzek
Dec 7 '17 at 16:02
You may have different results between
ls and ls -l, see unix.stackexchange.com/a/150456/211833â Patrick Mevzek
Dec 7 '17 at 16:05
You may have different results between
ls and ls -l, see unix.stackexchange.com/a/150456/211833â Patrick Mevzek
Dec 7 '17 at 16:05
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
I traversed the directories as you suggested and found the directory where "ls -al" started giving "Permission denied" errors. However, taht directory does have global read permissions enabled. Do I need global "x" perms also enabled in order to view a file?
â Dave
Dec 7 '17 at 16:12
For
ls -l, yes.â Patrick Mevzek
Dec 7 '17 at 16:21
For
ls -l, yes.â Patrick Mevzek
Dec 7 '17 at 16:21
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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%2funix.stackexchange.com%2fquestions%2f409511%2fgetting-permission-denied-even-though-i-have-set-global-read-permissions-on-a%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
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');
);
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');
);
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
2
Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
â Christopher
Dec 7 '17 at 15:45