I am running z/OS 1.13 and using the IBM Ported Tools sftp client.  I have some 
JCL from a few years back that I am using but it doesn't work anymore.  Any 

suggestions or observations would be appreciated.

//SFTP     EXEC PGM=BPXBATCH,                            
// PARM='PGM /bin/sftp -b //DD:CMDS [email protected]'      
//STDIN    DD DUMMY                                      
//STDOUT   DD PATH='/tmp/sftp.stdout',                   
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),          
//            PATHMODE=SIRWXU                            
//STDERR   DD PATH='/tmp/sftp.stderr',                   
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),          
//            PATHMODE=SIRWXU                            
//CMDS     DD *                                          
ascii                                                    
ls                                                       
quit                                                     
/*                                                       
//STDENV   DD *                                          
PATH=/bin                                                
DISPLAY=FOO                                              
SSH_ASKPASS=/bin/askpass                                 
PASSDSN=//'LDARP1.PASSWORD'                              
_BPX_BATCH_SPAWN=yes                                     
_BPX_SHAREAS=must                                        
//*   

 

I receive the following.

 

+BPXM047I BPXBATCH FAILED BECAUSE SPAWN (BPX1SPN) OF 
 /bin/sftp FAILED WITH RETURN CODE                   
 0000009D REASON CODE 0B1B0473.                      

.

.

BPXM047I BPXBATCH FAILED BECAUSE SPAWN (BPX1SPN) OF         
/bin/sftp FAILED WITH RETURN CODE                           
0000009D REASON CODE 0B1B0473.                              
IEF142I LDARP1SF SFTP - STEP WAS EXECUTED - COND CODE 2816  
IGD104I HFS FILE WAS RETAINED, DDNAME IS (STDOUT  )         
FILENAME IS (/tmp/sftp.stdout)                              
IGD104I HFS FILE WAS RETAINED, DDNAME IS (STDERR  )         
FILENAME IS (/tmp/sftp.stderr)      

 

This is my ssh_config file.

 

EDIT       /SYSTEM/etc/ssh/ssh_config       
Command ===>                                
****** *************************************
000001     PreferredAuthentications=password
000002     PasswordAuthentication=yes       
000003     PubkeyAuthentication=no          
000004     BatchMode yes                    
000005     Loglevel debug3                  
000006     Port 22222                       
000007     Cipher blowfish                  
000008     Cipher 3des                      

 

If I change my job to use z/OS Unix files I don't have the problem as in the 
above example.  I assume it is 

because I am not using DD allocations for //CMDS and 
PASSDSN=//'LDARP1.PASSWORD' .  However, using 

the '-b' option to point to a z/OS Unix file, my sftp job doesn't get a prompt 
for the password.  

 

//SFTP     EXEC PGM=BPXBATCH,                            
// PARM='PGM /bin/sftp -b /tmp/work.txt [email protected]' 
//STDIN    DD DUMMY                                      
//STDOUT   DD PATH='/tmp/sshd.stdout',                   
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),          
//            PATHMODE=SIRWXU                            
//STDERR   DD PATH='/tmp/sshd.stderr',                   
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),          
//            PATHMODE=SIRWXU                            
/*                                                       
//STDENV   DD *                                          
PATH=/bin                                                
DISPLAY=FOO                                              
SSH_ASKPASS=/bin/askpass                                 
_BPX_BATCH_SPAWN=no

_BPX_SHAREAS=must                                      

 

debug2: bits set: 500/1024                                                   
debug1: ssh_rsa_verify: signature correct                                    
debug2: kex_derive_keys                                                      
debug2: set_newkeys: mode 1                                                  
debug1: SSH2_MSG_NEWKEYS sent                                                
debug1: expecting SSH2_MSG_NEWKEYS                                           
debug2: set_newkeys: mode 0                                                  
debug1: SSH2_MSG_NEWKEYS received                                            
debug1: SSH2_MSG_SERVICE_REQUEST sent                                        
debug2: service_accept: ssh-userauth                                         
debug1: SSH2_MSG_SERVICE_ACCEPT received                                     
debug2: key: /pgp/doc/.ssh/id_rsa (0)                                        
debug2: key: /pgp/doc/.ssh/id_dsa (0)                                        
debug1: Authentications that can continue: publickey,password                
debug3: start over, passed a different list publickey,password               
debug3: preferred password                                                   
debug3: authmethod_lookup password                                           
debug3: remaining preferred:                                                 
debug1: No more authentication methods to try.                               
debug3: __catgets: NLS setup complete (1), using message catalog openssh.cat 
FOTS1373 Permission denied (publickey,password).  

 

Not using the '- b' option, and instead using STDIN, pointing to a z/OS Unix 
file for the sftp commands,

the sftp job works.  FYI - I updated /bin/askpass to process from a z/OS Unix 
file instead of a MVS data set.

 

//STEP020  EXEC PGM=BPXBATCH,                              
// PARM='PGM /bin/sftp [email protected]'       
//STDIN    DD PATH='/work/cmds',                           
//            FILEDATA=TEXT,PATHOPTS=ORDONLY,PATHDISP=KEEP 
//STDOUT   DD PATH='/tmp/sftp.stdout',                     
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),            
//            PATHMODE=SIRWXU                              
//STDERR   DD PATH='/tmp/sftp.stderr',                     
//            PATHOPTS=(OWRONLY,OCREAT,OTRUNC),            
//            PATHMODE=SIRWXU                              
/*                                                         
//STDENV   DD *                                            
PATH=/bin                                                  
DISPLAY=FOO                                                
SSH_ASKPASS=/bin/askpass                                   
_BPX_BATCH_SPAWN=yes                                       
_BPX_SHAREAS=yes                                           
//*                                                                             
                                 

   

The first example worked when I was running either z/OS 1.10 or 1.11.  My last 
example works, but I'm curious as to why this change in

behavior.  If I'm doing something wrong, please point it out to me, because I 
can't find it.       



_____________________________________________________________
Netscape.  Just the Net You Need.

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

Reply via email to