This is what I use:

//STEP01   EXEC PGM=BPXBATCH,                                      
//  PARM='sh sftp -b /u/systech/userid/put.chimes.ts.script -vvv   
//             [email protected]'             
//*                                                                
//STDENV   DD DSN=USERID.TSOLIB.PDS(ASKPASS),DISP=SHR              
//*                                                                
//STDERR   DD PATH='/u/systech/userid/srh04025.err06a',            
//          PATHOPTS=(OWRONLY,OCREAT,OTRUNC),                      
//          PATHMODE=(SIRWXU,SIRGRP)                               
//*                                                                
//STDOUT   DD PATH='/u/systech/userid/srh04025.msg06a',            
//          PATHOPTS=(OWRONLY,OCREAT,OTRUNC),                      
//          PATHMODE=(SIRWXU,SIRGRP)        

put.chimes.ts.script contains the sftp commands                       

USERID.TSOLIB.PDS(ASKPASS) contains: 
SSH_ASKPASS=/u/systech/userid/.ssh/askpassrds.sh

askpass.sh contains: echo password
--
 
Donald Grinsell
State of Montana
406-444-2983
[email protected]

"The secret of being miserable is to have leisure to bother about whether you 
are happy or not.  The cure for it is occupation."
~ George Bernard Shaw (1856-1950)

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Dana Mitchell
Sent: Wednesday, February 04, 2015 2:42 PM
To: [email protected]
Subject: SFTP in a batch job

Hello All,

We have a need to implement sftp transfers in place of some ftp batch jobs.  I 
have installed IBM Ported Tools OpenSSH, and can successfully use putty to log 
into my z/OS system (1.13).  From there I can connect to the remote sftp server 
on another platform and transfer files like a boss.  What I need to be able to 
do is transfer files via sftp in a batch job.  I can't figure out how to pass 
the user/password from a batch job. I see examples such as: 

//*                                      
//STEPNAME EXEC PGM=BPXBATCH,REGION=8M   
//STDERR   DD   SYSOUT=*                 
//STDOUT   DD   SYSOUT=*                 
//STDPARM  DD   *                        
SH sftp [email protected]    
/*                                       
//                                       

Also it would be a bonus if we could store userid/password in a seperate file 
like NETRC so that could be racf secured to only authorized users on the z/OS 
side.

Thanks
Dana

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to