Security Basics mailing list archives

RE: User can delete root's file from user's home directory


From: "Alexandre Skyrme" <alexandre.skyrme () ciphersec com br>
Date: Thu, 28 Oct 2004 15:05:05 -0300


Greetings Jimbo,

That behavior is normal. Test's home directory (/home/test) is owned by test
and he (probably) has write permission on it. That means he is allowed to
erase any files in the directory, no matter what user created the file. If
you try to change the data in the file created by root you won't be able to,
however you should be able to erase it and create a new one with whatever
data suits you.

In order to put a file in a user's home directory and prevent him from
erasing/altering/renaming it you could look at chattr (with the +i
attribute).

Regards,
--
Alexandre Skyrme
Cipher - Segurança da Informação
+55-21-2529-2629
www.ciphersec.com.br
 
Esta mensagem eletrônica pode conter informações privilegiadas e/ou
confidenciais, portanto fica o seu receptor notificado de que qualquer
disseminação, distribuição ou cópia não autorizada é estritamente proibida.
Se você recebeu esta mensagem indevidamente ou por engano, por favor,
informe este fato ao remetente e a apague de seu computador imediatamente.

This e-mail message may contain legally privileged and/or confidential
information, therefore, the recipient is hereby notified that any
unauthorized dissemination, distribution or copying is strictly prohibited.
If you have received this e-mail message inappropriately or accidentally,
please notify the sender and delete it from your computer immediately.



-----Original Message-----
From: Imre [mailto:jimbo () mailbox hu] 
Sent: quinta-feira, 28 de outubro de 2004 08:29
To: security-basics () securityfocus com
Subject: User can delete root's file from user's home directory


Hello

I have a big problem.
On my system I have 2 users, root and a test-user named test.
I made this:
(as root, in /home/test)
# touch testfile
# echo probe > testfile

After this I type 'ls -l' and get:

test:/home/test# ls -l
total 4
-rw-r--r--    1 root     root            6 Oct 28 13:27 testfile

OK, it's default, right?

But my problem starts here:

test@test:~$ ls -l
total 4
-rw-r--r--    1 root     root            6 Oct 28 13:27 testfile
test@test:~$ rm testfile
rm: remove write-protected file `testfile'? y
teszt@teszt:~$ ls -l
total 0
teszt@teszt:~$

I don't want to delete files and directories from my ~ which made by 
root. Could anyone help me?

(Sorry about my english, usually only read this language)

Thanks

Jimbo


Current thread: