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

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











up vote
-2
down vote

favorite
1












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?







share|improve this question


















  • 2




    Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
    – Christopher
    Dec 7 '17 at 15:45














up vote
-2
down vote

favorite
1












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?







share|improve this question


















  • 2




    Possible duplicate of Do the parent directory's permissions matter when accessing a subdirectory?
    – Christopher
    Dec 7 '17 at 15:45












up vote
-2
down vote

favorite
1









up vote
-2
down vote

favorite
1






1





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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








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












  • 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










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.






share|improve this answer




















  • 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 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










  • For ls -l, yes.
    – Patrick Mevzek
    Dec 7 '17 at 16:21










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%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






























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.






share|improve this answer




















  • 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 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










  • For ls -l, yes.
    – Patrick Mevzek
    Dec 7 '17 at 16:21














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.






share|improve this answer




















  • 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 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










  • For ls -l, yes.
    – Patrick Mevzek
    Dec 7 '17 at 16:21












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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










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 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










  • 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
















  • 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 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










  • For ls -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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)