Date: Mon, 16 Oct 2000 23:48:45 +0100 From: David Goddard <goddard@acm.org> To: freebsd-chat@FreeBSD.ORG Cc: David Scheidt <dscheidt@enteract.com>, Kris Kirby <kris@catonic.net> Subject: Re: Traditional UN*X conventions (Or: Why not to login as root?) Message-ID: <3.0.3.32.20001016234845.007cd100@dmg.parse.net> In-Reply-To: <Pine.NEB.3.96.1001016152627.52938B-100000@shell-2.enteract .com> References: <Pine.BSF.4.21.0010150739480.59649-100000@spaz.huntsvilleal.com>
index | next in thread | previous in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.3.32.20001016234845.007cd100>
