From owner-freebsd-chat Mon Oct 16 15:48:17 2000 Delivered-To: freebsd-chat@freebsd.org Received: from relay3.ftech.net (mrtg.ftech.net [195.200.0.119]) by hub.freebsd.org (Postfix) with ESMTP id 38C6D37B503 for ; Mon, 16 Oct 2000 15:48:05 -0700 (PDT) Received: from logger5.ftech.net ([195.200.0.64] helo=relay1.ftech.net) by relay3.ftech.net with esmtp (Exim 3.16-ftechp6 #1) id 13lJ35-0007H8-00; Mon, 16 Oct 2000 23:48:03 +0100 Received: from dmg.ftech.co.uk ([195.200.9.208] helo=cerebus.parse.net) by relay1.ftech.net with esmtp (Exim 3.16-ftechp6 #1) id 13lJ33-0005oD-00; Mon, 16 Oct 2000 23:48:02 +0100 Received: from elf (elf.putney.parse.net [10.0.0.10]) by cerebus.parse.net (8.9.3/8.9.3) with SMTP id XAA60321; Mon, 16 Oct 2000 23:47:19 +0100 (BST) (envelope-from goddard@acm.org) Message-Id: <3.0.3.32.20001016234845.007cd100@dmg.parse.net> X-Sender: dmg@dmg.parse.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32) Date: Mon, 16 Oct 2000 23:48:45 +0100 To: freebsd-chat@FreeBSD.ORG From: David Goddard Subject: Re: Traditional UN*X conventions (Or: Why not to login as root?) Cc: David Scheidt , Kris Kirby In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org At 15:30 16/10/00 -0500, David Scheidt wrote: ... >% cd >% rm -rf * .bak Actually, at the risk of being overly pedantic, on the FreeBSD systems that I've seen, the above would only wipe out either /root or the home directory of the user that su'd (depending on how things were set up), I think (but I'm not about to go around trying it). >done as dms will annoy me and send me scurrying for the backup tapes or >disks. Done as root, I'll be much more than annoyed. I'll have users after >me! And a wasted evening while I rebuild the system. I don't do anything >as root, with the exception of user administration, and installing or >removing software. Yeah, but I'm sure that Murphy's Law or one of its evil cousins means that when you *do* make that typo, it'll be when you're logged on as root in order to do something essential. Personally, I like to have something like this in my .cshrc file: if (${me} == 'root') then alias rm rm -i alias mv mv -i alias cp cp -i endif It's not infallible (it won't protect you from wanton use of -f for example), but it helps... My own nightmare happened a while back was when I was logged onto a Solaris box. I wanted to change some file group ownerships, so happily typed something like: $ cd /path/directory $ su Password: $ chgrp -R lusergroup * Of course, on *this* box, as soon as I su'd, it changed my directory to /, with obvious hilarious consequences (not). There's nothing like spending ages fixing your damage to educate you that it's generally a much better idea to do $ somepotentiallybadcommand -R directory rather than $ somepotentiallybadcommand -R * :-( Dave To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-chat" in the body of the message