setting root's shell???

setting root's shell???

Post by Steve Doli » Sat, 20 Jul 1996 04:00:00



I would like root's shell to be Korn shell. at present it is sh.  the
admin tool will not allow me to modify user root (that's me).  can anyone
tell me how to do this.
thanks,
steve doliov

 
 
 

setting root's shell???

Post by Al Roethlisberg » Sat, 20 Jul 1996 04:00:00



>I would like root's shell to be Korn shell. at present it is sh.  the
>admin tool will not allow me to modify user root (that's me).  can anyone
>tell me how to do this.
>thanks,
>steve doliov

If you take a look at the passwd file under /etc, you can vipw the
file and change the shell.  But, be careful, if you accidentally point
to a shell that is corrupt or nonexistent, root will be out of luck.

The best thing to do is just execute the shell you would like once
root is logged in.  You can do this manually at the prompt, or edit
your .profile in / to lauch the proper shell once you log in.

Al

 
 
 

setting root's shell???

Post by Neil Ricke » Sat, 20 Jul 1996 04:00:00



Quote:>I would like root's shell to be Korn shell. at present it is sh.  the
>admin tool will not allow me to modify user root (that's me).  can anyone
>tell me how to do this.
>thanks,
>steve doliov

Don't do it.  It is a mistake you will regret.

Instead, create a new user account.  Perhaps you could call it
'kroot'.  Copy everything from the 'root' entry in your passwd file,
except the shell.  Then login/su to 'kroot' whenever you want the
korn shell.

If you ever have to do system repairs in single user mode, you may
find that 'ksh' is not usable, and you will appreciate the value of
leaving the root account with '/sbin/sh'.

 
 
 

setting root's shell???

Post by Rachel Polansk » Sun, 21 Jul 1996 04:00:00





>>I would like root's shell to be Korn shell. at present it is sh.  the
>>admin tool will not allow me to modify user root (that's me).  can anyone
>>tell me how to do this.
>>thanks,
>>steve doliov

> If you take a look at the passwd file under /etc, you can vipw the
> file and change the shell.  But, be careful, if you accidentally point
> to a shell that is corrupt or nonexistent, root will be out of luck.

> The best thing to do is just execute the shell you would like once
> root is logged in.  You can do this manually at the prompt, or edit
> your .profile in / to lauch the proper shell once you log in.

Here is something I picked up in a newsgroup somewhere,
that checks for a shell's viability before permitting it's
execution.

just put this in your root's .profile,
and execute the shell of your choice.

I use "bash" and then pass it the "-login" argument to make
it load root's .bash_profile....

########################################################################

# define bash as root's shell if available

(PATH='/ " \'; exec 1>&- 2>&-; typset -l) ||
{ 2>&- /usr/bin/bash -c : && exec /usr/bin/bash -login; }

########################################################################

rachel

--
Rachel Polanskis                 Kingswood, Greater Western Sydney, Australia


                Witty comment revoked due to funding cuts

 
 
 

setting root's shell???

Post by Ling Wan » Tue, 23 Jul 1996 04:00:00




> >I would like root's shell to be Korn shell. at present it is sh.  the
> >admin tool will not allow me to modify user root (that's me).  can anyone
> >tell me how to do this.
> >thanks,
> >steve doliov

> Don't do it.  It is a mistake you will regret.

> Instead, create a new user account.  Perhaps you could call it
> 'kroot'.  Copy everything from the 'root' entry in your passwd file,
> except the shell.  Then login/su to 'kroot' whenever you want the
> korn shell.

> If you ever have to do system repairs in single user mode, you may
> find that 'ksh' is not usable, and you will appreciate the value of
> leaving the root account with '/sbin/sh'.

If you put /usr and / on the same partition, then it should
not be a problem to use dll(PC term) shells.
 
 
 

setting root's shell???

Post by Marcel Teeuwe » Tue, 23 Jul 1996 04:00:00



> I would like root's shell to be Korn shell. at present it is sh.  the
> admin tool will not allow me to modify user root (that's me).  can anyone
> tell me how to do this.
> thanks,
> steve doliov

First look if it's appropriate to have the (dymically linked) ksh, then
start it if appropriate:

        if [ -x /usr/bin/ksh ]; then            # /usr is mounted
                SHELL=/usr/bin/ksh
                export SHELL
        fi

        exec $SHELL     # don't start if you want CDE or OpenWindows

Marcel

 
 
 

setting root's shell???

Post by Kevin Brintna » Thu, 25 Jul 1996 04:00:00



> I would like root's shell to be Korn shell. at present it is sh.  the
> admin tool will not allow me to modify user root (that's me).  can
> anyone tell me how to do this.

First off, from what I can tell it looks like you're using root for your
regular activities.  This is a mistake and will eventually lead to all
sorts of problems..

Secondly, changing root's shell is stupid..  What you ought to do is su
to root and then exec your favorite shell.  Adding things to root's
profile, even with some sort of sanity checking, is a little risky and
unnecessary.  What I do is put the following in my .zshrc:

SU=`which su`
su () {
  if [ "$1" = "" ]
  then
    ${SU} root -c "exec zsh"
  else
    ${SU} $*
  fi

Quote:}

This is easy to do and doesn't have the potential risks that changing
root's shell or .profile does.


 
 
 

setting root's shell???

Post by Ed Shannonhou » Sat, 27 Jul 1996 04:00:00


Quote:>    if [ -x /usr/bin/ksh ]; then            # /usr is mounted
>            SHELL=/usr/bin/ksh
>            export SHELL
>    fi

Don't you mean:

if [ -x /usr/bin/ksh ]; then            # /usr is mounted
        setenv SHELL /usr/bin/ksh
fi

Ed Shannonhouse

EDS, Indiana Resource Center
Kokomo, IN, USA

 
 
 

setting root's shell???

Post by Tony Walto » Tue, 30 Jul 1996 04:00:00




> >       if [ -x /usr/bin/ksh ]; then            # /usr is mounted
> >               SHELL=/usr/bin/ksh
> >               export SHELL
> >       fi

> Don't you mean:

> if [ -x /usr/bin/ksh ]; then            # /usr is mounted
>         setenv SHELL /usr/bin/ksh
> fi

No he does NOT mean this - the whole point of this piece of script is to
assume that the root shell is default (/sbin/sh) unless /usr/bin/ksh is
available.

The default root shell is Bourne shell which doesn't understand the
"setenv" builtin (peculiar to csh). If you need to use "setenv" then you
have already altered the default root shell (to /bin/csh) - somewhat
removing the point of the script fragment.

If you want to run csh as root then you should follow Marcel's advice
but replace /usr/bin/ksh with /usr/bin/csh in the fragment above.

Regards

Tony Walton
Sun Microsystems

My opinions may not coincide with those of Sun Microsystems at all times

 
 
 

1. I changed root's shell and doesn't login as root

Hi all,

I changed root's shell from csh to ksh in /etc/passwd file, and logout from
root.
I try to login as root but error message is "ksh doesn't exist".
so, i look up the ksh, and the shell's path is incorrect.
now i want to change the root's shell again, but i can not do it, coz i
can't login as root

please help me

thanks in advance

Jaguk Ku

2. breaking up the pagemap_lru_lock in rmap

3. Setting root's shell to /bin/csh -- is this overkill or what?

4. Oracle Web Server on Solaris

5. using c shell as root's shell in AIX

6. Linux on 43P-140?

7. change Korn shell as root's default shell

8. w95 screwed up my lpr

9. Why can't I use 'set' in B shell

10. HELP - lost root's shell and can't log in.

11. 'failed running login shell' no non-root user login possible

12. Thwarting the `Don't mess with root shell' dictum

13. run a shell script as the 'root' user