su command not working within request script

From: Shekar (ctippur_at_msn.com)
Date: 03/16/05


Date: 16 Mar 2005 11:39:34 -0800

All,

I have a request script which uses "su - user -c "pwd"" -OR- "su - user
-c "echo $SHELL"" to determine the users shell and home directory. We
had to do it this way because user maybe authenticated using
nis/ldap/or local passwd. During pkgadd, we see that it is prompting
for password. This is weird because when we run this command as root,
it should not ask for password. I am not sure what is happening.
Couple of interesting observations:
1. This seem to happen only on solaris 8 boxes which have been upgraded
to the latest patch level (117350-21).
2. Request script, when run individually, runs fine which leads us to
believe that pkg install is creating this problem.
I would like to know if I am thinking on right lines. I would also like
to know if there is an alternate method to determine user's shell by
root.

Thanks for your input in advance.

Shekar



Relevant Pages

  • Re: init + orphaned processes
    ... > We have a vendor application that is invoked from ... > users shell after they login. ... DeeDee, don't press that button! ...
    (comp.unix.admin)
  • Re: hi all..
    ... and someone gets access your shell account, ... Only root can install an su binary. ... Of course, if I have sudo ...
    (Fedora)
  • Re: Kmail offline
    ... GUI sessions as root? ... I will not help you with problems running GUI as root. ... That was a straight copy paste from the shell it ran from. ... checking I could get it to do said the install was all right. ...
    (Fedora)
  • Re: csh as default root Shell
    ... Another source is the the FreeBSD Handbook that is available ... As for changing the root shell, it is probably not a good idea. ... Put the new root account you created farther down in the passwd file ...
    (freebsd-questions)
  • Re: "No Shell"
    ... There is simply no need to login as root - ever, ... > you don't have to guard(and spread) root's password anymore. ... And change the shell or whatever it s/he just well damn ... Other than that nothing else should depend on root shell, ...
    (comp.unix.admin)