Setting up coZ SFTP and getting: 'subsystem request failed on channel 0' error

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
drew.aj
Posts: 1
Joined: Tue May 02, 2023 9:31 am

Setting up coZ SFTP and getting: 'subsystem request failed on channel 0' error

Post by drew.aj »

Hello,

I am setting up coZ for SFTP so, we can FTp bi-directionally with non-mainframe servers.

Specifically, we need to have the files end up on the non-USS/Unix side of the mainframe for scheduling triggering purposes.

In trying to SFTP from a RHEL system to z/OS, I installed the toolkit client code. When I invoke a command like this:
/opt/dovetail/coz/bin/todsn -ssh <user>@<mainframe system> -r //<regular.mf.dataset> < sftpTest.txt

I get the response:
subsystem request failed on channel 0

I have updated the /etc/ssh/sshd_config file's subsystem line to look like - Subsystem sftp /usr/local/coz/bin/sftp-server.sh - and issued the 'kill -s HUP $(cat /var/run/sshd.pid)' command on the system I am connecting, so not sure what I have missed for the setup?

Anyone else run into this issue?

Thanks!
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Re: Setting up coZ SFTP and getting: 'subsystem request failed on channel 0' error

Post by coz »

I think you are confusing Co:Z SFTP with Co:Z Dataset Pipes.

If you want to transfer a file from a remote unix system to a z/OS system running Co:Z SFTP Server, you would use a standard SFTP client, not 'todsn', which is a Dataset Pipes component. So for example on your RHEL system, you could use the OpenSSH sftp client to make your transfer. The session would look something like this:

Code: Select all

$ sftp <user>@<mainframe system>
Connected to <mainframe system>.
sftp> ls /+mode=text,lrecl=255,recfm=vb,space=cyl.1.1
/+mode=text,lrecl=255,recfm=vb,space=cyl.1.1                   
sftp> put sftpTest.txt //regular.mf.dataset
Uploading sftpTest.txt to //regular.mf.dataset
sftpTest.txt                                                                                 100%  581     9.3KB/s   00:00    
sftp> quit
See the following section of the Co:Z SFTP User's Guide for more information on how to transfer to z/OS datasets with the Co:Z SFTP Server: https://coztoolkit.com/docs/sftp/using.html#ds

On the other hand, to use 'todsn' from your remote system, you would need to configure the Co:Z Dataset Pipes subsystem in your sshd_config. The documentation for doing this is here: https://coztoolkit.com/docs/dspipes/dsp-install.html but that's probably not what you want, based on your post.
Post Reply