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

Re: [cobalt-users] Keeping a file from being deleted



Steve,

>> If you mean chown root/chgrp root and then chmod 444 the file in question
>> I tried that last night and again just now no luck.
>
> Can you elaborate on why that solution does not work for you?  If you can,
> go to the directory containing the file and do "ls -l" and paste the output
> into your reply.

  Easily, any file under "your" directory - regardless of ownership or mode, 
can be "deleted" by "you" - all you have to do is say "yes" (y) to the 
question that pops up asking if you are "sure"....  Nature of "*nix" systems.

EXAMPLE from an RAQ4:

<< first as ROOT create a dummy file in a user space >>
[root web]# touch testfile

<< then login as this "regular" user >>>
<< note prompt>>
[larry2 web]$ ls -l
total 15
drwxrwsr-x  10 larry2   home         1024 Feb  1 22:08 .
drwxrws--x   3 larry2   home         1024 Oct 22 12:37 ..
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 _private
drwxrwsr-x   4 larry2   home         1024 Jan 15  2001 _vti_bin
drwxrwsr-x   2 larry2   home         1024 Jun 11  2001 _vti_cnf
drwxrwsr-x   2 larry2   home         1024 Jun 11  2001 _vti_pvt
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 _vti_txt
drwxr-sr-x   2 larry2   home         1024 May 23  2001 cgi-bin
drwxr-sr-x   2 larry2   home         1024 May 23  2001 guestbook
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 images
-rw-rw-r--   1 larry2   home         4985 Jan 15  2001 index.html
-rw-r--r--   1 root     home            0 Feb  1 22:08 testfile
[larry2 web]$ rm testfile
rm: remove write-protected file `testfile'? y
[larry2 web]$ ls -l
total 15
drwxrwsr-x  10 larry2   home         1024 Feb  1 22:09 .
drwxrws--x   3 larry2   home         1024 Oct 22 12:37 ..
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 _private
drwxrwsr-x   4 larry2   home         1024 Jan 15  2001 _vti_bin
drwxrwsr-x   2 larry2   home         1024 Jun 11  2001 _vti_cnf
drwxrwsr-x   2 larry2   home         1024 Jun 11  2001 _vti_pvt
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 _vti_txt
drwxr-sr-x   2 larry2   home         1024 May 23  2001 cgi-bin
drwxr-sr-x   2 larry2   home         1024 May 23  2001 guestbook
drwxrwsr-x   2 larry2   home         1024 Jan 15  2001 images
-rw-rw-r--   1 larry2   home         4985 Jan 15  2001 index.html
[larry2 web]$

<< note the file is GONE>>

 As stated before, the ONLY way to ensure the file cannot be removed is with 
the chattr command.

Larry Smith
SysAd ECSIS.NET
sysad@xxxxxxxxx