Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
51
rated 0 times [  51] [ 0]  / answers: 1 / hits: 4830  / 2 Years ago, wed, january 12, 2022, 7:35:25

I have this file:



$ ls -l  store.sh 
-rwxr-xr-x 1 root apache 117 Feb 5 2016 store.sh

$ id
uid=48(apache) gid=48(apache) groups=48(apache)


I think that I haven't the permission to edit this file but was possible delete and replace the file. How can it be? Can someone explain this behaviour?


More From » permissions

 Answers
0

You don't need write permissions on a file to delete or move (rename) it. You need write permissions on the directory containing the file, because deleting or renaming are not operations on the file, but operations on the directory's list of files. So in this case the directory of this file probably has write access for the apache user or the apache group.


[#9105] Thursday, January 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
shadowoof

Total Points: 293
Total Questions: 112
Total Answers: 137

Location: Burkina Faso
Member since Sun, Nov 21, 2021
3 Years ago
;