Co:Z FTP-SSH as a SOCKS5 proxy: Uncaught exception...

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
fagu
Posts: 14
Joined: Wed Dec 02, 2009 8:51 am

Co:Z FTP-SSH as a SOCKS5 proxy: Uncaught exception...

Post by fagu »

Sorry that I failed to supply the JCL used for the transfer. Is found at the end of this post.

Fails at "dir cbt.foobar.text".

2014-02-18 14:41:56,660 WARN ProxyConnection[/127.0.0.1:4696] - Uncaught exception
java.io.IOException: channel is not opened.

Changing target library works OK, but "dir /u/foobar1/..." will also fail.

quote cwd 'foobar1.zin3'
put cbt cbt.foobar.text
quote cwd /u/foobar1
put cbt cbt.foobar.text


EZA1736I put cbt cbt.foobar.text
EZA1701I >>> SITE FIXrecfm 80 LRECL=80 RECFM=FB BLKSIZE=27920
200 SITE command was accepted
EZA1701I >>> EPSV
229 Entering Extended Passive Mode (|||65327|)
EZA1701I >>> STOR cbt.foobar.text
125 Storing data set FOOBAR1.ZIN3.CBT.FOOBAR.TEXT
250 Transfer completed successfully.
EZA1617I 1886 bytes transferred in 0.005 seconds. Transfer rate 377.20 Kbytes/sec.
EZA1460I Command:
EZA1736I dir cbt.foobar.text
EZA1701I >>> EPSV
229 Entering Extended Passive Mode (|||65323|)
EZA1701I >>> LIST cbt.foobar.text
125 List started OK
EZA2284I Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
EZA2284I Z3VO01 3390 2014/02/18 1 1 FB 80 27920 PS CBT.FOOBAR.TEXT
EZA2589E Connection to server interrupted or timed out. Waiting for reply
EZA1721W Server not responding, closing connection.
EZA1735I Std Return Code = 14125, Error Code = 00009


1
JVMJZBL1001N JZOS batch Launcher Version: 2.4.5 2013-08-22
JVMJZBL1002N (C) Copyright IBM Corp. 2005, 2013
java version "1.7.0"
Java(TM) SE Runtime Environment (build pmz3170_27-20131115_04)
IBM J9 VM (build 2.7, JRE 1.7.0 z/OS s390-31 20131114_175264 (JIT enabled, AOT enabled)
J9VM - R27_Java727_GA_20131114_0833_B175264
JIT - tr.r13.java_20131113_50523
GC - R27_Java727_GA_20131114_0833_B175264
J9CL - 20131114_175264)
JVMJZBL1023N Invoking com.dovetail.ftpsshproxy.ProxyServer.main()...

1
2014-02-18 14:39:44,393 INFO ProxyServer - Co:Z FTP-SSH Proxy - version: 1.0.1
2014-02-18 14:39:44,546 INFO ProxyServer - Copyright (C) Dovetailed Technologies, LLC. 2008. All rights reserved.
2014-02-18 14:39:44,607 INFO ProxyServer - listening on *:1080
2014-02-18 14:41:09,646 INFO ProxyConnection[/127.0.0.1:4693] - proxy negotiated to /10.10.10.77:21
2014-02-18 14:41:09,650 INFO FtpControlSession[/127.0.0.1:4693] - client login accepted for userid "foobar1"
2014-02-18 14:41:54,694 INFO FtpControlSession$SshUserInfo[/127.0.0.1:4693] - +----------------------------------------------------
------+
| z/OS OpenSSH server: ZIN3 |
+----------------------------------------------------------+
02014-02-18 14:41:54,955 INFO FtpControlSession[/127.0.0.1:4693] - SSH control channel started to 10.10.10.77:21
2014-02-18 14:41:56,307 INFO FtpControlSession[/127.0.0.1:4693] [/10.10.10.77:21] - server login accepted for userid "foobar1"
2014-02-18 14:41:56,428 INFO FtpControlSession[/127.0.0.1:4693] [/10.10.10.77:21] - server registered passive port: 65327
2014-02-18 14:41:56,430 INFO ProxyConnection[/127.0.0.1:4695] - proxy negotiated to /10.10.10.77:65327
2014-02-18 14:41:56,481 INFO FtpControlSession[/127.0.0.1:4695] - SSH data channel started to 10.10.10.77:65327
2014-02-18 14:41:56,605 INFO FtpControlSession[/127.0.0.1:4693] [/10.10.10.77:21] - server registered passive port: 65323
2014-02-18 14:41:56,607 INFO ProxyConnection[/127.0.0.1:4696] - proxy negotiated to /10.10.10.77:65323
2014-02-18 14:41:56,660 WARN ProxyConnection[/127.0.0.1:4696] - Uncaught exception
java.io.IOException: channel is not opened.
at com.dovetail.ftpsshproxy.ProxyConnection.runProxySession(ProxyConnection.java:141)
at com.dovetail.ftpsshproxy.ProxyConnection.doRun(ProxyConnection.java:91)
at com.dovetail.ftpsshproxy.ProxyConnection.run(ProxyConnection.java:72)
at java.lang.Thread.run(Thread.java:853)
2014-02-18 14:43:56,624 INFO FtpControlSession[/127.0.0.1:4693] [/10.10.10.77:21] - disconnected SSH
2014-02-18 14:43:56,624 INFO ProxyConnection[/127.0.0.1:4693] [/10.10.10.77:21] - control connection closed

//*
//*********************************************************************
//* Fagu: SYS1.SAMPLIB(JVMJCL71)
//* JOBLIB DD DISP=SHR,DSN=SYS1.SIEALNKE.JZOS *** new JZOS
//*********************************************************************
//* Co:Z FTP-SSH dynamically proxies FTP connections over SSH to an SSHD
//* server running on the target host. The required client changes can
//* be made without affecting existing FTP jobs or scripts. In addition,
//* since all connections between the client and server are tunneled
//* through a single secure SSH connection, the firewall and NAT router
//* difficulties that commonly plague FTPS (FTP over SSL or TLS) are
//* avoided.
//*********************************************************************
//* Co:Z FTP-SSH as a SOCKS5 proxy
//* Implements FTP over SSH without SFTP
//* Licensed under the Apache License, Version 2.0
//* - http://dovetail.com/docs/ftpsshproxy/licenses.html
//*********************************************************************
//*
//* Sample job to run Co:Z ftpsshproxy
//*
//* Tailor the proc and job for your installation:
//* 1.) Modify the Job card per your installation's requirements
//* 2.) Add PROCLIB card if needed to point to JVMPRC14 proc
//* 3.) Modify JAVA_HOME to point the location of the SDK
//* 4.) Modify APP_HOME to point to the location of ftpsshproxy.jar
//*
//* Note: this JCL may also be converted to run as a started task
//*********************************************************************
//PROXY EXEC PROC=JVMPRC71, <-- the IBM SDK JZOS proc
// JAVACLS='com.dovetail.ftpsshproxy.ProxyServer',
//* LOGLVL='+D', <== fagu debug JZOS
//* ARGS='-h 1080 -d' <== fagu debug java code
// ARGS='-h 1080' <- listen on all interfaces, port 1080 (default)
//* Fagu: port can not be changed |||||
//* ARGS='-h 127.0.0.1:1080' <- listen on loopback interface, port 1080
//*
//*** STEPLIB DD DISP=SHR,DSN=SYS1.SIEALNKE.JZOS *** new JZOS
//STDENV DD *
# This is a shell script which configures
# any environment variables for the Java JVM.
# Variables must be exported to be seen by the launcher.

. /etc/profile
export JAVA_HOME=/usr/lpp/java/J7.1

# Fagu: proxy dedicated to this TCP/IP stack
# export RESOLVER_CONFIG="//'TCPTE.ZIN1.TCPZIN11.TCPPARM(TCPDATA)'"
# export _BPXK_SETIBMOPT_TRANSPORT=TCPZIN11
# Fagu: proxy attached to all TCPZINxx servers
export RESOLVER_CONFIG=""
export _BPXK_SETIBMOPT_TRANSPORT=

# Fagu: get debug messages (but messages disappera somewhere?
export _EDC_ADD_ERRNO2=1
export _BPXK_JOBLOG=STDERR

# Modify these two lines to match your installation:
COZ_HOME=/usr/local/ftpsshproxy

export PATH=/bin:"${JAVA_HOME}"/bin

LIBPATH=/lib:/usr/lib:"${JAVA_HOME}"/bin
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390
LIBPATH="$LIBPATH":"${JAVA_HOME}"/lib/s390/j9vm
LIBPATH="$LIBPATH":"${JAVA_HOME}"/bin/classic
export LIBPATH="$LIBPATH":

# Customize your CLASSPATH here
APP_HOME=$COZ_HOME
CLASSPATH=$APP_HOME:"${JAVA_HOME}"/lib:"${JAVA_HOME}"/lib/ext

# Add Application required jars to end of CLASSPATH
for i in "${APP_HOME}"/*.jar; do
CLASSPATH="$CLASSPATH":"$i"
done
export CLASSPATH="$CLASSPATH":

# Configure JVM options
IJO="-Xms16m -Xmx128m"

# A default encoding of ISO8859-1 is required
IJO="$IJO -Dfile.encoding=ISO8859-1"
export IBM_JAVA_OPTIONS="$IJO "

//

...the JCL used at ZIN1

//FTPJOB EXEC PGM=FTP,PARM='(EXIT'
//SYSPRINT DD SYSOUT=*,DCB=BLKSIZE=133
//SYSABEND DD SYSOUT=*
//* VERY VERY VERBOUS
//SYSFTPD DD DISP=SHR,DSN=TCPTE.ZIN1.TCPZIN11.TCPPARM(FTPSOCKS)
//SYSTCPD DD DISP=SHR,DSN=TCPTE.ZIN1.TCPZIN11.TCPPARM(TCPDATA)
//SYSOUT DD SYSOUT=*
//FTPOUT DD SYSOUT=*
//SYSIN DD * ZIN31 is z/OS1.13
zin31
foobar1 password
ascii
locsite sbd=(ibm-1143,ibm-5348)
quote site CTRLConn=FTP_STANDARD_TABLE

lcd /usr/lpp/java
lcd 'foobar1.zin1.jcl'
quote cwd 'foobar1.zin3'

quote site recfm=fb lrecl=80 blksize=0
quote site track primary=15 secondary=15

put cbt cbt.foobar.text
dir cbt.foobar.text

pwd

close
quit
//*
Post Reply