Newsgroups: comp.unix.shell Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!theory.tn.cornell.edu!christos From: christos@theory.tn.cornell.edu (Christos S. Zoulas) Subject: Re: tcsh for root -- ok or not? Message-ID: <1991Apr9.010306.524@batcomputer.tn.cornell.edu> Sender: news@batcomputer.tn.cornell.edu Nntp-Posting-Host: theory.tn.cornell.edu Organization: Electrical Engineering, Cornell University, Ithaca NY References: <1991Apr8.033015.14768@athena.mit.edu> Distribution: comp.unix.shell Date: Tue, 9 Apr 1991 01:03:06 GMT In article jc@condor.bu.edu (James Cameron) writes: >The only "problem" with using tcsh as the default root shell is that >when you want to upgrade your operating system, the new one might not >come with tcsh (at least SunOS has yet to do so.) So, just remember >to change your shell before the upgrade and things are fine...otherwise >root won't be able to log in multi-user. > Yeah, this is one of the problems. The main problem though for a root account is that in most cases it has to be shared by more than one people. Everyone has different preferences for aliases and $variables, and this makes it difficult to share the account. We try to solve the problem by keeping only the minimum setup in /.cshrc and do the rest in our own .cshrc. In the setup we have here we only login as root in case of emergency, otherwise we use su. The default root shell is csh, but we have the following in /.cshrc: # # When we exec tcsh on an su # we source the person's .cshrc, and we make our home # be the person's home. # if ( $?tcsh ) then if ( $HOSTTYPE != "hp9000s300" ) then set me = `who am i | awk -F\! '{ print $2 }'` else set me = `who am i` endif if ( $me[1] != "root" ) then set home = `ypmatch $me[1] passwd | awk -F: '{ print $6 }'` source $home/.cshrc endif endif .... alias et exec tcsh In my personal .cshrc I have a section which is executed when $uid == 0. This changes the prompt, and removes dot from the path, and aliases rm to rm -i etc... In that way everyone who has root priviledges gets his own aliases and working environment. So I just need to type 'et' after I su, and there I feel right at home... christos -- +------------------------------------------------------------------------+ | Christos Zoulas | 389 Theory Center, Electrical Engineering, | | christos@ee.cornell.edu | Cornell University, Ithaca NY 14853. | | christos@crnlee.bitnet | Phone: (607) 255 0302 | Fax: (607) 254 4565 |