[unix-pc.general] Non-standard shell and su.

lenny@icus.UUCP (Lenny Tropiano) (01/03/88)

What is the problem giving root (or any login for that matter) /bin/ksh
for the default login shell and then using the "su <name> -c <cmd>" to
execute a command?  I keep getting:

$ su root -c "rm xx"
Password:
Non-standard shell - denied

Does the "-c" option only work with the Bourne shell (/bin/sh)?  I would
like root to have /bin/ksh.  I have to cludge it up with leaving the
default shell blank in /etc/passwd and then in the .profile put a:

exec /bin/ksh

This is annoying.

						-Lenny
-- 
============================ US MAIL:   Lenny Tropiano, ICUS Computer Group
 IIIII   CCC   U   U   SSSS             PO Box 1
   I    C   C  U   U  S                 Islip Terrace, New York  11752
   I    C      U   U   SSS   PHONE:     (516) 968-8576 [H] (516) 582-5525 [W] 
   I    C   C  U   U      S  AT&T MAIL: ...attmail!icus!lenny  TELEX: 154232428
 IIIII   CCC    UUU   SSSS   UUCP:
============================    ...{uunet!godfre, harvard!talcott}!\
                   ...{ihnp4, boulder, mtune, bc-cis, ptsfa, sbcs}! >icus!lenny 
"Usenet the final frontier"        ...{cmcl2!phri, hoptoad}!dasys1!/

wjc@ho5cad.ATT.COM (01/04/88)

In article <200@icus.UUCP> lenny@icus.UUCP (Lenny Tropiano) writes:
>  [su with "-c" problem described]
>   Does the "-c" option only work with the Bourne shell (/bin/sh)?  I would
>   like root to have /bin/ksh.  I have to cludge it up with leaving the
>   default shell blank in /etc/passwd and then in the .profile put a:
>
>   exec /bin/ksh
>
>   This is annoying.

I don't know why it's done that  way, but it  looks like the check for
/bin/sh is coded into /bin/su.  (From a look at the binary.)

Another ploy for getting  ksh for root  is to simply  link /bin/ksh on
top of /bin/sh.  I've been running this way for quite a while  with no
problems (3.5).  I  do recall  some ancient problems with cron scripts
breaking and  log  files  growing forever  in the   2.5/3.0 days,  but
something fixed that.

	Bill Carpenter
	(AT&T gateways)!ho5cad!wjc
	HO 1L-410, (201)949-8392