Controlling dubbed and spawned address space names in JES2

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
Jadon
Posts: 9
Joined: Fri Sep 11, 2015 6:46 pm

Controlling dubbed and spawned address space names in JES2

Post by Jadon »

With CoZ SFTP enabled, is there something we can add to the /<path>/coz/bin/sftp-server.sh to control the new address spaces that are created in JES2 when someone connects to the sshd daemon for SSH shell or SFTP? When someone connects, we have a dubbed address space start that remains in step STEP1 and a second (what appears to be) child spawn or fork address space that remains in the *OMVSEX step. These address spaces always have the name SSHDS1 through 9. We'd like to control the address space names that are generated and have them instead be prefixed with the caller's userid. I'm thinking this may be possible using the _BPX_JOBNAME variable. Any thoughts?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Controlling dubbed and spawned address space names in JES2

Post by dovetail »

Yes, you can do this, but you have to set _BPX_JOBNAME in exactly the right place.

For example (in /etc/ssh/sshd_config):

Subsystem sftp "_BPX_JOBNAME=SFTPD /usr/lpp/coz/bin/sftp-server.sh"

Notice that the surrounding double-quotes are required in order to get SSHD to parse it right.
What makes this work is that SSHD starts the subsystem with a shell, using: -c "_BPX_JOBNAME=SFTPD /usr/lpp/coz/bin/sftp-server.sh"

Because of the way that SSHD starts a subsystem, you will end up with (3) OMVS address spaces:

1) The SSHD server for your connection (/usr/sbin/sshd)
2) The "sh -c" shell (sh -c ...) which is fork/execed by SSHD
3) the Co:Z sftp-server.sh script and the program it runs

Only the last one will get the SFTPD jobname.
Post Reply