Co:Z SFTP batch Permission denied issue

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
jloweDt
Posts: 4
Joined: Wed Apr 24, 2019 9:35 pm

Co:Z SFTP batch Permission denied issue

Post by jloweDt »

Hello,
Running Co:Z SFTP on a Development LPAR and it is working OK. Installed Co:Z SFTP on a production LPAR and Co:Z SFTP batch jobs are failing with Permission denied. The batch job fails using a pub key extracted from a RACF certificate and a public key I generated for my userid. Two separate public keys both failing with Permission denied. However the job works if I do not use the ". $script_dir/sftp_put.sh" command but use a "put' command.

Job FAILS Permission denied using the following commands:
user=userid
host=ip address
lzopts="mode=text"
rfile=/u/home/userid/file_name
lfile=//DD:ZOSDD
. $script_dir/sftp_put.sh

Job WORKS using the following commands:
user=userid
host=ip address
lzopts="mode=text"
. $script_dir/sftp_connect.ssh << EOB
put //MVS.DATASET.NAME remote.file.name
EOB

If anyone has any idea as to whythe job fails let me know. Thank You
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Co:Z SFTP batch Permission denied issue

Post by dovetail »

This message in general means that your SSH authention method (password, publickey, etc) failed.
In order to diagnose, we would need to see an SSH trace.
To obtain this, add the following to your shell script (prior to invoking sftp_put.sh)

ssh_opts="$ssh_opts -vvv"

You can then post the results here, but you may wish to obfuscate any userids, ip addresses or host names.
jloweDt
Posts: 4
Joined: Wed Apr 24, 2019 9:35 pm

Re: Co:Z SFTP batch Permission denied issue

Post by jloweDt »

Reviewed the IBM Ported Tools for z/OS: OpenSSH - Key Authentication presentation (ssh_keys_part1_2012-06-12.pdf) Slide 20 Common Pitfalls and found the problem with an incorrect Permission bit setting.. Thanks jim
Post Reply