On Tue, Nov 09, 2004 at 07:15:01PM +0000, Michael Graham wrote: > Ben Hutchings wrote: > > Christopher Swingley wrote: > >> Change the ownership and permissions on their .bash_profile and .bashrc > >> to root:root 644: > >> > >> -rw-r--r-- 1 root root 420 Sep 21 13:05 > >> .bash_profile -rw-r--r-- 1 root root 746 Sep 21 > >> 13:05 .bashrc > > > > You should also add the sticky bit to their directory (chmod +t) to > > prevent them from replacing these files. > > I feel the need to learn something new today. How could the user replace > the root owned files in a directory that they own?
I think they could do rm -r dir_in_question to remove the directory. (At least I can on my system. I get asked if I want to remove a write-protected file, then it gets removed.) Prior to that you could move all the files you want to keep to new directory and then move them back when you've finished. Then add your own replacement to the deleted root-owned file. > > -- > OoberMick > > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > -- David Jardine "Running Debian GNU/Linux and loving every minute of it." -Sacher M. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]