Protection from the dreaded "rm -fr /"

Giorgos Keramidas keramida at freebsd.org
Sat Oct 2 10:57:08 PDT 2004


On 2004-10-02 21:23, Lee Harr <missive at hotmail.com> wrote:
> >John Beck, who works for Sun, has posted an entry in his blog yesterday
> >about "rm -fr /" protection, which I liked a lot:
> >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection
> >
> >His idea was remarkably simple, so I went ahead and wrote this patch for
> >rm(1) of FreeBSD:
>
> How about:
>
> chflags sunlnk /
> ?

Setting sunlink on / will only protect the / directory, not its
descendants, so you don't gain much.



More information about the freebsd-hackers mailing list