How can my user delete a root owned file?
I created the esm directory with my user `xcanm`.
$ ls -ld esm/ drwxr-xr-x 6 xcanm users 4096 Ago 17 00:35 esm/ $ cd esm/ Inside I have the a.dd file owned by root.root $ ll total 489504 -rw-r--r-- 1 root root 501211136 Ago 17 00:25 a.dd -rw-r--r-- 1 root root 32768 Dez 31 1979 $RFS_LOG.LO$ drwxr-xr-x 3 root root 4096 Ago 17 00:31 VIDEO Using my user, I'm able to delete the file, although with this question. $ rm a.dd (translated) rm: remove regular file «a.dd» write protected?y $ ll total 36 -rw-r--r-- 1 root root 32768 Dez 31 1979 $RFS_LOG.LO$ drwxr-xr-x 3 root root 4096 Ago 17 00:31 VIDEO Maybe it's too late for me at night... Is it me or this should not happen? |
Hi,
because you own the directory. Evo2. |
It all has to do with understanding how permissions work under Linux. Here's two link to start you off with:
http://mywiki.wooledge.org/Permissions http://www.grymoire.com/Unix/Permissions.html Also, have a look this thread: http://www.linuxquestions.org/questi...gs-4175414285/ |
As above, you own the directory and the dir has rwx for the owner. Who owns the files inside (or their permissions) is irrelevant (unless you use the sticky bit on the directory).
|
Yes, you can remove a file that you can't open, because from Linux's point of view you're removing the directory-entry that points to the file (inode). The now-orphaned inode goes away because nothing points to it.
|
All times are GMT -5. The time now is 02:59 PM. |