Re: File Deletion issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Russell Johns wrote:
> H-
> 
> forgive my ignorance, but I'm not understanding whats going wrong here
> ...
> essentially a large file that I own I can't delete...
> why do I not have permission to delete this file???
> 
> [rcj@Merak2 Archive]$ rm rcj.iso
> rm: cannot remove `rcj.iso': Permission denied
> [rcj@Merak2 Archive]$ chmod 777 rcj.iso
> [rcj@Merak2 Archive]$ rm rcj.iso
> rm: cannot remove `rcj.iso': Permission denied
> [rcj@Merak2 Archive]$ ls -l
> total 423972
> -rwxrwxrwx    1 rcj      xcdroast 433717248 Oct 21 10:39 rcj.iso
> [rcj@Merak2 Archive]$ chown rcj.rcj rcj.iso
> [rcj@Merak2 Archive]$ rm rcj.iso
> rm: cannot remove `rcj.iso': Permission denied
> [rcj@Merak2 Archive]$ rm -f rcj.iso
> rm: cannot remove `rcj.iso': Permission denied
> [rcj@Merak2 Archive]$
> 
> 

In Unix, when you "remove" a regular file, you are removing a link 
(rcj.iso) that refers to the file (remember that files can have multiple 
"hard" links); when the file has no more links remaining, the file itself 
is removed (after all openers of the file have closed it).

Permission to remove a link to a file is determined by the security of the 
directory containing the link ("Archive" in your case). You must have 
write permission to a directory in order to create or remove entries in 
that directory. Additionally, if the "sticky" bit is on in a directory's 
mode (ls -ld <directory> shows "t" as the last character of the 
directory's mode string) then you must be root or must be the owner of the 
file referred to by a link in order to be able to remove the link. /tmp 
often has the sticky bit set to prevent users from being able to unlink 
other users' temporary files.

Hope that helps.

-Tom
-- 
Tom Eastep    \ Shorewall - iptables made easy
AIM: tmeastep  \ http://www.shorewall.net
ICQ: #60745924  \ teastep@shorewall.net



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux