tcsh for root -- ok or not?

Christos S. Zoulas christos at theory.tn.cornell.edu
Tue Apr 9 11:03:06 AEST 1991


In article <JC.91Apr8024148 at condor.bu.edu> jc at 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 at ee.cornell.edu | Cornell University, Ithaca NY 14853.         |
| christos at crnlee.bitnet  | Phone: (607) 255 0302 |  Fax: (607) 254 4565 |



More information about the Comp.unix.shell mailing list