On Wed, 14 Jul 2010 09:41:15 -0500, John McKown <[email protected]> wrote:

>On Wed, 2010-07-14 at 15:08 +0100, Andy Robertson wrote:
>> We have users on boxen who are SSH-ing in to our z/OS system to run a 
>> program that WTORs to the console and sets a simple return code based on the 
>> reply.
>>
>> We put the program that does the WTOR on a private directory in the z/OS 
>> filesystem.
>>
>> At the moment, when the SSH is issued from a box, the process that starts up 
>> on z/OS has only the standard directories in its PATH
>>
>> Is there any way to add our aforementioned private directory to the PATH for 
>> SSH users??
>> I'm sorry if i've missed an obvious solution: been delving into this a few 
>> days now . ..
>
>They SSH into z/OS UNIX and get a UNIX shell prompt? If so, then just
>set the PATH for their shell prompt using the appropriate mechanism. For
>the normal IBM /bin/sh, that would be ~/.profile . That is, the
>".profile" file in the user's home directory.
>
>export PATH=${PATH}:/new/sub/directory
>
My experience, with Solaris hosts, not z/OS, it that if I supply a
command on the ssh line, sshd runs a non-login shell:

    504 $ ssh -X u...@solaris     'echo $SHELL; pwd; echo $PATH'
    u...@solaris's password: 
    /usr/bin/ksh
    $HOME         # (obfuscated)
    /usr/bin:/bin:/usr/sbin:/sbin

I think this is goodness.  When I want merely to issue a remote command,
I don't want the overhead of ~/.profile getting in the way.  And when
I distribute a script that runs a command via ssh, I certainly don't
want the customer's ~/profile interfering.

I've resigned myself to qualifying paths in ssh commands.

>Now, if you have some other requirement, such as setting the PATH
>globally for all SSH users and only SSH users, you could try code
>in /etc/profile such as:
>
>set . $(ps -o args -p $PPID)
>case "$3" in
>*sshd*) export PATH=$PATH:/special/ssh/sub/directory;;
>esac
>
I suspect none of this works when sshd executes a non-login shell.

Can the OP create aliases or scripts on the various boxen to issue
the command with a qualified path?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to