Unable to remove or change files after setfacl rwx-command

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
With root-user, I've executed this command:
setfacl -R -d -m u:MYUSER:rwx /myfolder
When I then change to that user ( su MYUSER ) and try to remove a file ( rm /myfolder/somefile.sql then I get the this error:
rm: cannot remove 'somefile.sql': Permission denied
I can't mv it either; then I get this error:
mv: cannot move 'somefile.sql' to 'someotherfile.sql': Permission denied
I've added MYUSER to /etc/sudoers, - so when I run: sudo rm /myfolder/somefile.sql, then I'm prompted for MYUSERs password; and then it works. But I need it to work without sudo, so I can run it as a crontab-job.
If I write getfacl /myfolder, then I get this output:
# file: /myfolder/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx <-- That looks right, doesn't it?
default:group::r-x
default:mask::rwx
default:other::r-x
... Why in the name of Zeus can't I remove files in this directory?
permissions users setfacl
add a comment |Â
up vote
1
down vote
favorite
With root-user, I've executed this command:
setfacl -R -d -m u:MYUSER:rwx /myfolder
When I then change to that user ( su MYUSER ) and try to remove a file ( rm /myfolder/somefile.sql then I get the this error:
rm: cannot remove 'somefile.sql': Permission denied
I can't mv it either; then I get this error:
mv: cannot move 'somefile.sql' to 'someotherfile.sql': Permission denied
I've added MYUSER to /etc/sudoers, - so when I run: sudo rm /myfolder/somefile.sql, then I'm prompted for MYUSERs password; and then it works. But I need it to work without sudo, so I can run it as a crontab-job.
If I write getfacl /myfolder, then I get this output:
# file: /myfolder/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx <-- That looks right, doesn't it?
default:group::r-x
default:mask::rwx
default:other::r-x
... Why in the name of Zeus can't I remove files in this directory?
permissions users setfacl
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
With root-user, I've executed this command:
setfacl -R -d -m u:MYUSER:rwx /myfolder
When I then change to that user ( su MYUSER ) and try to remove a file ( rm /myfolder/somefile.sql then I get the this error:
rm: cannot remove 'somefile.sql': Permission denied
I can't mv it either; then I get this error:
mv: cannot move 'somefile.sql' to 'someotherfile.sql': Permission denied
I've added MYUSER to /etc/sudoers, - so when I run: sudo rm /myfolder/somefile.sql, then I'm prompted for MYUSERs password; and then it works. But I need it to work without sudo, so I can run it as a crontab-job.
If I write getfacl /myfolder, then I get this output:
# file: /myfolder/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx <-- That looks right, doesn't it?
default:group::r-x
default:mask::rwx
default:other::r-x
... Why in the name of Zeus can't I remove files in this directory?
permissions users setfacl
With root-user, I've executed this command:
setfacl -R -d -m u:MYUSER:rwx /myfolder
When I then change to that user ( su MYUSER ) and try to remove a file ( rm /myfolder/somefile.sql then I get the this error:
rm: cannot remove 'somefile.sql': Permission denied
I can't mv it either; then I get this error:
mv: cannot move 'somefile.sql' to 'someotherfile.sql': Permission denied
I've added MYUSER to /etc/sudoers, - so when I run: sudo rm /myfolder/somefile.sql, then I'm prompted for MYUSERs password; and then it works. But I need it to work without sudo, so I can run it as a crontab-job.
If I write getfacl /myfolder, then I get this output:
# file: /myfolder/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx <-- That looks right, doesn't it?
default:group::r-x
default:mask::rwx
default:other::r-x
... Why in the name of Zeus can't I remove files in this directory?
permissions users setfacl
asked Mar 23 at 10:17
Zeth
1205
1205
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
3
down vote
accepted
MYUSER is a default owner, but not an effective owner.
You need to run both
setfacl -R -d -m u:MYUSER:rwx /myfolder
setfacl -R -m u:MYUSER:rwx /myfolder
note second command do not have a default (-d/--default) flag.
this sould result in getfacl giving
# file: /myfolder/
# owner: root
# group: root
user::rwx
user:MYUSER:rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
add a comment |Â
up vote
1
down vote
setfacl (it's about the same for firewalld) should always be run twice. Once with -d to set the default permissions that will affect newly created files and without it for the actual files.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
MYUSER is a default owner, but not an effective owner.
You need to run both
setfacl -R -d -m u:MYUSER:rwx /myfolder
setfacl -R -m u:MYUSER:rwx /myfolder
note second command do not have a default (-d/--default) flag.
this sould result in getfacl giving
# file: /myfolder/
# owner: root
# group: root
user::rwx
user:MYUSER:rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
add a comment |Â
up vote
3
down vote
accepted
MYUSER is a default owner, but not an effective owner.
You need to run both
setfacl -R -d -m u:MYUSER:rwx /myfolder
setfacl -R -m u:MYUSER:rwx /myfolder
note second command do not have a default (-d/--default) flag.
this sould result in getfacl giving
# file: /myfolder/
# owner: root
# group: root
user::rwx
user:MYUSER:rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
MYUSER is a default owner, but not an effective owner.
You need to run both
setfacl -R -d -m u:MYUSER:rwx /myfolder
setfacl -R -m u:MYUSER:rwx /myfolder
note second command do not have a default (-d/--default) flag.
this sould result in getfacl giving
# file: /myfolder/
# owner: root
# group: root
user::rwx
user:MYUSER:rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
MYUSER is a default owner, but not an effective owner.
You need to run both
setfacl -R -d -m u:MYUSER:rwx /myfolder
setfacl -R -m u:MYUSER:rwx /myfolder
note second command do not have a default (-d/--default) flag.
this sould result in getfacl giving
# file: /myfolder/
# owner: root
# group: root
user::rwx
user:MYUSER:rwx
group::r-x
other::r-x
default:user::rwx
default:user:MYUSER:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
edited Mar 23 at 14:28
answered Mar 23 at 11:58
Archemar
18.9k93366
18.9k93366
add a comment |Â
add a comment |Â
up vote
1
down vote
setfacl (it's about the same for firewalld) should always be run twice. Once with -d to set the default permissions that will affect newly created files and without it for the actual files.
add a comment |Â
up vote
1
down vote
setfacl (it's about the same for firewalld) should always be run twice. Once with -d to set the default permissions that will affect newly created files and without it for the actual files.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
setfacl (it's about the same for firewalld) should always be run twice. Once with -d to set the default permissions that will affect newly created files and without it for the actual files.
setfacl (it's about the same for firewalld) should always be run twice. Once with -d to set the default permissions that will affect newly created files and without it for the actual files.
answered Mar 23 at 13:33
dev93
115
115
add a comment |Â
add a 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%2f433030%2funable-to-remove-or-change-files-after-setfacl-rwx-command%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