Answer the question
In order to leave comments, you need to log in
[[+content_image]]
Linux administration, no access to file?
[[email protected] nightmare]$ ls
partial.php test.txt
[[email protected] nightmare]$ ls -la
total 8
drwxr-xr-x 2 apache apache 41 Feb 26 13:26 .
drwxr-xr-x 5 root root 53 Feb 26 12:38 ..
-rw-rw-r-- 1 nightmare0 nightmare0 1753 Feb 26 13:06 partial.php
-rw-r--r-- 1 apache apache 13 Feb 26 13:26 test.txt
[[email protected] nightmare]$ groups
nightmare0 apache
[[email protected] nightmare]$ rm test.txt
rm: remove write-protected regular file ‘test.txt’? y
rm: cannot remove ‘test.txt’: Permission denied
[[email protected] nightmare]$
Answer the question
In order to leave comments, you need to log in
In the answers, they correctly sent me to learn Linux rights.
But they forgot to note that deleting a file is not an operation on the file, but on the folder in which it lies. You need write access to it to create or delete files.
Therefore, file permissions do not play here at all - -rw-r--r--/apache/apache.
And the folder permissions decide: drwxr-xr-x/apache/apache.
In which, however, the user, by belonging to the apache group, has the same access - read only.
The test.txt file has the apache group as does the nightmare0 user, but nightmare0 cannot delete the file.
drwxr-xr-x 2 apache apache 41 Feb 26 13:26 .
the rights of the apache rx group, that is, you cannot edit the directory.
Deleting a file is changing the directory.
You need to either be an apache / root user, or add rwxrwxr-x permissions to the folder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question