Where is 'su' profile?? - HP UX

This is a discussion on Where is 'su' profile?? - HP UX ; At work , my other 2 IT guys often need to su , I try to get them to do an 'su -' but they always forget the '-' since they are used to just doing an su for all ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Where is 'su' profile??

  1. Where is 'su' profile??

    At work , my other 2 IT guys often need to su , I try to get them to do
    an 'su -' but they always forget the '-' since they are used to just
    doing an su for all these years. My problem is , where is the profile
    kept for the generic 'su' command. I moved all of our admin scripts
    into a handy directory, so it wont be cluttered with the OS files, we
    used to keep them all in /usr/bin , so they were available anywhere,
    but I think that is a Big No NO, so I opted to put them elsewhere. I
    added this path to the root profile, but it does not work unless we do
    'su -'....

    Im stumped..

    any help would be appreciated


  2. Re: Where is 'su' profile??

    "thesoulcrusher" writes:

    > At work , my other 2 IT guys often need to su , I try to get them to do
    > an 'su -' but they always forget the '-' since they are used to just
    > doing an su for all these years. My problem is , where is the profile
    > kept for the generic 'su' command. I moved all of our admin scripts
    > into a handy directory, so it wont be cluttered with the OS files, we
    > used to keep them all in /usr/bin , so they were available anywhere,
    > but I think that is a Big No NO, so I opted to put them elsewhere. I
    > added this path to the root profile, but it does not work unless we do
    > 'su -'....


    There is no specific profile for the "generic su" command: su
    without the '-' changes the user's identity but leaves the user's
    environment as is. The environment includes the HOME environment
    variable, which is used to determine where the per-user login scripts
    are expected to be. In effect, the "su" session would use the same shell
    startup files that the user's normal session would.

    Furthermore, 'su -' produces a shell that is considered a "login
    shell", so it will run /etc/profile and $HOME/.profile. The plain 'su'
    is just a sub-shell, so it normally won't execute profile scripts at
    all.

    You might be able to use the ENV variable to run a script when a
    subshell is started. The intended use for this is to set up shell functions,
    aliases and other stuff that doesn't get inherited from one shell to
    its subshell. This means you'll have to make all environment variable
    changes conditional, so that the user won't e.g. get a PATH that looks
    like ...:/usr/local/sbin:/usr/local/sbin:/usr/local/sbin
    when the user makes a 'su', then edits something, uses the editor's
    shell escape and then does something else. With PATH this is usually
    just ugly; with something else, it could cause problems.

    --
    Matti.Kurkela@welho.com

  3. Re: Where is 'su' profile??

    Matti Juhani Kurkela wrote:
    > "thesoulcrusher" writes:
    >
    > > At work , my other 2 IT guys often need to su , I try to get them to do
    > > an 'su -' but they always forget the '-' since they are used to just
    > > doing an su for all these years.


    Or you could just use sudo instead and take everyone out of the wheel
    group. Here's the main site..

    http://www.courtesan.com/sudo/

    ....you can get it in depot form here....

    http://hpux.cs.utah.edu/

    ..... but if you're on 11.23 you might find RBAC from HP more elegant...

    http://h20293.www2.hp.com/portal/swd...=AccessControl

    Have fun,
    Dave


+ Reply to Thread