Hello,
We are in the process converting our FTP batch jobs to using COZBATCH.
The FTP job's read a dataset that contains the Host address,Userid and Password,which are then picked up by the FTP proc:
10.6.130.109
ftptsg s1lver22
Is it possible to use the exisitng dataset using the SSH_ASKPASS environment variable ? whereby we can pass the Userid and password,instead of the password only ?
Thanking you in advance.
SSH_ASKPASS Variables
The SSH_ASKPASS variable is used by IBM Ported Tools OpenSSH to point to a Unix command or shell script to run. The output of this program must be a single line containing the password.
If you look at our sample JCL: RUNSFTP, you will see that we point to a shell script "read_passwd_dsn.sh" which reads from the dataset pointed to by $PASSWD_DSN.
If you are trying to reuse your existing datasets, in the exact syntax as you have described, you will have to write some of your own shell scripts to parse the dataset:
1) A replacement for "read_passwd_dsn.sh" that will echo the second word on the second line of the dastaset.
Here's a suggestion for such a shell script (put this in an executable HFS file):
2) Some shell commands, perhaps inline, that read the ip address and username from the same dataset into variables that can be used on the cozsftp command line.
If you look at our sample JCL: RUNSFTP, you will see that we point to a shell script "read_passwd_dsn.sh" which reads from the dataset pointed to by $PASSWD_DSN.
If you are trying to reuse your existing datasets, in the exact syntax as you have described, you will have to write some of your own shell scripts to parse the dataset:
1) A replacement for "read_passwd_dsn.sh" that will echo the second word on the second line of the dastaset.
Here's a suggestion for such a shell script (put this in an executable HFS file):
Code: Select all
#! /bin/sh
coz_bin=`dirname $0`
"$coz_bin/fromdsn" -x shr "$PASSWD_DSN" | awk 'NR==2 {print $2}'
Code: Select all
server=$($coz_bin/fromdsn -x shr $PASSWD_DSN | awk 'NR==1 {print $1}' )
remoteuser=$($coz_bin/fromdsn -x shr $PASSWD_DSN | awk 'NR==2 {print $1}' )