File create permission error although dir has 777 permission
On running command touch file
I am getting error
touch: cannot touch 'file': permission denied
Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.
Tried strace
to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:
open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACESS (Permission denied)
I tried to create file with specific permissions as well but getting permission error, command tried is:
install -b -m 511 /dev/null file
linux files permissions filesystems strace
|
show 1 more comment
On running command touch file
I am getting error
touch: cannot touch 'file': permission denied
Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.
Tried strace
to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:
open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACESS (Permission denied)
I tried to create file with specific permissions as well but getting permission error, command tried is:
install -b -m 511 /dev/null file
linux files permissions filesystems strace
Is the user that cannot create a file in the directory able to navigate (i.e.,cd
) to that directory?
– Andy Dalton
Oct 7 '17 at 5:26
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
1
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47
|
show 1 more comment
On running command touch file
I am getting error
touch: cannot touch 'file': permission denied
Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.
Tried strace
to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:
open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACESS (Permission denied)
I tried to create file with specific permissions as well but getting permission error, command tried is:
install -b -m 511 /dev/null file
linux files permissions filesystems strace
On running command touch file
I am getting error
touch: cannot touch 'file': permission denied
Although I have 777 permissions on the dir where I am trying to create file but still not able to create file with one particular user, some other users can create files there.
Tried strace
to see what might be root cause but not able to to understand strace output.
One line and I guess relevant as well of strace output is:
open("file", O_WRONGLY|O_CREATE|O_NOCTTY|O_NONBLOCK, 0666) = -1 EACESS (Permission denied)
I tried to create file with specific permissions as well but getting permission error, command tried is:
install -b -m 511 /dev/null file
linux files permissions filesystems strace
linux files permissions filesystems strace
edited Nov 12 at 6:11
RalfFriedl
5,3033925
5,3033925
asked Oct 7 '17 at 4:47
Vipin
1013
1013
Is the user that cannot create a file in the directory able to navigate (i.e.,cd
) to that directory?
– Andy Dalton
Oct 7 '17 at 5:26
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
1
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47
|
show 1 more comment
Is the user that cannot create a file in the directory able to navigate (i.e.,cd
) to that directory?
– Andy Dalton
Oct 7 '17 at 5:26
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
1
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47
Is the user that cannot create a file in the directory able to navigate (i.e.,
cd
) to that directory?– Andy Dalton
Oct 7 '17 at 5:26
Is the user that cannot create a file in the directory able to navigate (i.e.,
cd
) to that directory?– Andy Dalton
Oct 7 '17 at 5:26
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
1
1
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47
|
show 1 more comment
2 Answers
2
active
oldest
votes
Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl
.
Get current ACL - You can check permissions for any file or directory with getfacl. See example below.
# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---
Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory
add a comment |
Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .
Please see that once , if there are some permission problems from Root directory to your current directory .
One Other reason may be , check selinux is enabled or not .
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
add a comment |
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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/3.0/"u003ecc by-sa 3.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
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396619%2ffile-create-permission-error-although-dir-has-777-permission%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl
.
Get current ACL - You can check permissions for any file or directory with getfacl. See example below.
# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---
Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory
add a comment |
Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl
.
Get current ACL - You can check permissions for any file or directory with getfacl. See example below.
# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---
Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory
add a comment |
Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl
.
Get current ACL - You can check permissions for any file or directory with getfacl. See example below.
# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---
Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory
Possibly it is overriden by a filesystem access control list. Possibly Linux ACL? You may determine that by using lsfacl
.
Get current ACL - You can check permissions for any file or directory with getfacl. See example below.
# getfacl dir/
file: dir
owner: root
group: root
user::rwx
group::---
other::---
Set permissions with ACL -
You may set "mode" 0777 for a directory with inheritance in the access control lists with setfacl -d -m o::rwx /directory
answered Oct 8 '17 at 13:09
William Sandin
29115
29115
add a comment |
add a comment |
Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .
Please see that once , if there are some permission problems from Root directory to your current directory .
One Other reason may be , check selinux is enabled or not .
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
add a comment |
Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .
Please see that once , if there are some permission problems from Root directory to your current directory .
One Other reason may be , check selinux is enabled or not .
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
add a comment |
Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .
Please see that once , if there are some permission problems from Root directory to your current directory .
One Other reason may be , check selinux is enabled or not .
Some time you have sufficient permission on the current directory in which you want to create file but don't have permission on parent directories in hierarchy .
Please see that once , if there are some permission problems from Root directory to your current directory .
One Other reason may be , check selinux is enabled or not .
answered Oct 7 '17 at 5:50
Sahil Aggarwal
992
992
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
add a comment |
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
2
2
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
Can you explain this sometimes case, why it might happen ? Although this is not true in my case. Generally users doesn't have access to all parent dirs in hierarchy.
– Vipin
Oct 7 '17 at 6:01
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
If the OP can get to the directory in question, parent permissions have no more relevance.
– roaima
Nov 12 at 7:52
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396619%2ffile-create-permission-error-although-dir-has-777-permission%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
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
Is the user that cannot create a file in the directory able to navigate (i.e.,
cd
) to that directory?– Andy Dalton
Oct 7 '17 at 5:26
@AndyDalton yes
– Vipin
Oct 7 '17 at 5:31
Does a file with that name already exist, and if so is it owned by a different user?
– Andy Dalton
Oct 7 '17 at 5:34
Please check this answer. https://unix.stackexchange.com/questions/369012/umask-not-working
– user3411123
Oct 7 '17 at 5:39
1
@user3411123 the question you gave looks like completely different to me
– Vipin
Oct 7 '17 at 5:47