Discussion:
[JSch-users] How to upload/download files from MVS system.
brijesh kadecha
2006-07-13 12:52:31 UTC
Permalink
Hi,

My requirement is uploading/downloading files from different systems on different platforms. For uploading/downloading files from MVS server, we first need to pass some site parameters to the server (for normal ftp using Jakarta's commons.net API we use FTPClient.sendSiteCommand() for this purpose). I have following doubts.

1. How can we send site parameters in SFTP?
2. How can we set Binary mode/ASCII mode before file transfer in SFTP?
3. The SFTP example provided here runs on JVM1.4 but gives error on JVM 1.3 (NoMethodFoundError for method java.net.INetAddress.getByAddress().). What modifications are needed to run this example on JVM 1.4?
4. When I executed SFTP example on my system with out line System.exit() then application did not terminated even after quit/exit. I observed that there were 7 child threads still active so application did not terminated. Is it a bug?

Thanks & Regards
Brij


---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
brijesh kadecha
2006-07-14 10:08:53 UTC
Permalink
Hi All,

Further analysis,

Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

Thanks & Regards
Brij


brijesh kadecha <***@yahoo.com> wrote: Hi,

My requirement is uploading/downloading files from different systems on different platforms. For uploading/downloading files from MVS server, we first need to pass some site parameters to the server (for normal ftp using Jakarta's commons.net API we use FTPClient.sendSiteCommand() for this purpose). I have following doubts.

1. How can we send site parameters in SFTP?
2. How can we set Binary mode/ASCII mode before file transfer in SFTP?
3. The SFTP example provided here runs on JVM1.4 but gives error on JVM 1.3 (NoMethodFoundError for method java.net.INetAddress.getByAddress().). What modifications are needed to run this example on JVM 1.4?
4. When I executed SFTP example on my system with out line System.exit() then application did not terminated even after quit/exit. I observed that there were 7 child threads still active so application did not terminated. Is it a bug?

Thanks & Regards
Brij


---------------------------------
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JSch-users mailing list
JSch-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users



---------------------------------
How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.
Atsuhiko Yamanaka
2006-07-14 15:05:54 UTC
Permalink
Hi,

+-From: brijesh kadecha <***@yahoo.com> --
|_Date: Fri, 14 Jul 2006 03:08:53 -0700 (PDT) ______
|
| Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

On the sftp protocol, SITE command is not defined, unfortunately.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
Atsuhiko Yamanaka
2006-07-14 15:24:48 UTC
Permalink
Hi,

+-From: brijesh kadecha <***@yahoo.com> --
|_Date: Thu, 13 Jul 2006 05:52:31 -0700 (PDT) ______
|
| 1. How can we send site parameters in SFTP?
| 2. How can we set Binary mode/ASCII mode before file transfer in SFTP?
The sftp protocol does not support Binary/ASCII mode.

| 3. The SFTP example provided here runs on JVM1.4 but gives error on JVM 1.3 (NoMethodFoundError for method java.net.INetAddress.getByAddress().). What modifications are needed to run this example on JVM 1.4?
Try 'JSch for J2ME CDC' on http://j2me.jsch.org/ . That version will also
run on J2SE 1.3 platform.

| 4. When I executed SFTP example on my system with out line System.exit() then application did not terminated even after quit/exit. I observed that there were 7 child threads still active so application did not terminated. Is it a bug?

I can not reproduce such a problem. At least, System.exit() should
terminate JavaVM. What kind of JavaVM are you using?

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
Munroe, Seth A
2006-07-14 15:47:41 UTC
Permalink
The example program is a java application (which differs from an applet)
that uses visual components (the JOptionpane that asks for the ***@host
value). Any time visual components are used the VM needs to be told when
to stop. This can be done with the System.exit(int) call or an
application that runs as a visual window (JFrame) would usually call
jframeInstance.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);.

When the default close operation is not set and the application does not
specifically call System.exit(int), threads remain running which is what
was described in issue 4.

-----Original Message-----
From: jsch-users-***@lists.sourceforge.net
[mailto:jsch-users-***@lists.sourceforge.net] On Behalf Of Atsuhiko
Yamanaka
Sent: Friday, July 14, 2006 8:25 AM
To: ***@yahoo.com
Cc: jsch-***@lists.sourceforge.net
Subject: Re: [JSch-users] How to upload/download files from MVS system.

Hi,

+-From: brijesh kadecha <***@yahoo.com> --
|_Date: Thu, 13 Jul 2006 05:52:31 -0700 (PDT) ______
|
| 1. How can we send site parameters in SFTP?
| 2. How can we set Binary mode/ASCII mode before file transfer in
SFTP?
The sftp protocol does not support Binary/ASCII mode.

| 3. The SFTP example provided here runs on JVM1.4 but gives error
on JVM 1.3 (NoMethodFoundError for method
java.net.INetAddress.getByAddress().). What modifications are needed to
run this example on JVM 1.4?
Try 'JSch for J2ME CDC' on http://j2me.jsch.org/ . That version will
also run on J2SE 1.3 platform.

| 4. When I executed SFTP example on my system with out line
System.exit() then application did not terminated even after quit/exit.
I observed that there were 7 child threads still active so application
did not terminated. Is it a bug?

I can not reproduce such a problem. At least, System.exit() should
terminate JavaVM. What kind of JavaVM are you using?

Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/


------------------------------------------------------------------------
-
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your job
easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
brijesh kadecha
2006-07-17 06:41:40 UTC
Permalink
Hi,
Thanks for reply.

If SFTP protocol does not support 'SITE' command then how can we upload/download files from MVS system?. I thought SFTP provides all functionality of FTP protocol but additionaly provides secured communication.

While FTP we send some file parameters via SITE commands. These site parameters may be 'quote SITE sbd=.........' or 'cylinders pri=1 sec=1'. These types of parameters, we were passing using SITE commands in case of simple FTP. I think these parameters are specific to MVS system & without these parameters we can not upload/download files from MVS system.

For simple FTP we were using jakarta's commons.net API's methods FTPClient.sendSiteParameters().

But if I want to upload/download files from MVS thru SFTP then how can I achieve this task. Since SFTP is secured version of FTP so there should be some workaround to achieve such task. Please let me know how can I achieve this task?.

Thanks & Rregards
Brij

Atsuhiko Yamanaka <***@jcraft.com> wrote: Hi,

+-From: brijesh kadecha --
|_Date: Fri, 14 Jul 2006 03:08:53 -0700 (PDT) ______
|
| Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

On the sftp protocol, SITE command is not defined, unfortunately.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/



---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
Oberhuber, Martin
2006-07-17 07:46:10 UTC
Permalink
Hi Brij,

you are misunderstanding. SFTP is _not_ just a secured version of FTP, it is something different.

I see two alternatives for you:

a) Get an ssh server for MVS that supports standard sftp (not sure if such a server exists).

b) Instead of SFTP, use FTP-over-ssh. It works like this:
* ssh does port forwarding of port #21 through its secure connection
* you use a standard FTP client to access the standard MVS FTP server - but through the forwarded port

When I remember right, you were writing your own Java FTP client -- adding jsch port forwarding to that
client should be easy to do.

Cheers,
Martin
--
Martin Oberhuber - WindRiver, Austria
+43(662)457915-85





________________________________

From: jsch-users-***@lists.sourceforge.net [mailto:jsch-users-***@lists.sourceforge.net] On Behalf Of brijesh kadecha
Sent: Monday, July 17, 2006 8:42 AM
To: jsch-***@lists.sourceforge.net
Subject: Re: [JSch-users] How to upload/download files from MVS system.


Hi,
Thanks for reply.

If SFTP protocol does not support 'SITE' command then how can we upload/download files from MVS system?. I thought SFTP provides all functionality of FTP protocol but additionaly provides secured communication.

While FTP we send some file parameters via SITE commands. These site parameters may be 'quote SITE sbd=.........' or 'cylinders pri=1 sec=1'. These types of parameters, we were passing using SITE commands in case of simple FTP. I think these parameters are specific to MVS system & without these parameters we can not upload/download files from MVS system.

For simple FTP we were using jakarta's commons.net API's methods FTPClient.sendSiteParameters().

But if I want to upload/download files from MVS thru SFTP then how can I achieve this task. Since SFTP is secured version of FTP so there should be some workaround to achieve such task. Please let me know how can I achieve this task?.

Thanks & Rregards
Brij

Atsuhiko Yamanaka <***@jcraft.com> wrote:

Hi,

+-From: brijesh kadecha --
|_Date: Fri, 14 Jul 2006 03:08:53 -0700 (PDT) ______
|
| Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

On the sftp protocol, SITE command is not defined, unfortunately.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/




________________________________

Yahoo! Messenger with Voice. Make PC-to-Phone Calls <http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com> to the US (and 30+ countries) for 2¢/min or less.
brijesh kadecha
2006-07-17 11:57:43 UTC
Permalink
Hi Martin,
Thanks for help.

I guess FTP over SSH is also known as FTPS?. Presently we are using commons.net APIs of Jakarta for FTP.

Can you plz guide me how can I do PortForwarding? I saw there are 2 examples, PortForwardingL & PortForwardingR (But I dont know difference between them).
Presently I m directly calling FTPClient.connect(), FTPClient.storeFile() etc methods. Where FTPClient is API of Jakarta. Plz guide me how can I achieve ssh Port forwarding?

Thanks & Regards
Brij

"Oberhuber, Martin" <***@windriver.com> wrote: Hi Brij,

you are misunderstanding. SFTP is _not_ just a secured version of FTP, it is something different.

I see two alternatives for you:

a) Get an ssh server for MVS that supports standard sftp (not sure if such a server exists).

b) Instead of SFTP, use FTP-over-ssh. It works like this:
* ssh does port forwarding of port #21 through its secure connection
* you use a standard FTP client to access the standard MVS FTP server - but through the forwarded port

When I remember right, you were writing your own Java FTP client -- adding jsch port forwarding to that
client should be easy to do.
Cheers,
Martin
--
Martin Oberhuber - WindRiver, Austria
+43(662)457915-85




---------------------------------
From: jsch-users-***@lists.sourceforge.net [mailto:jsch-users-***@lists.sourceforge.net] On Behalf Of brijesh kadecha
Sent: Monday, July 17, 2006 8:42 AM
To: jsch-***@lists.sourceforge.net
Subject: Re: [JSch-users] How to upload/download files from MVS system.



Hi,
Thanks for reply.

If SFTP protocol does not support 'SITE' command then how can we upload/download files from MVS system?. I thought SFTP provides all functionality of FTP protocol but additionaly provides secured communication.

While FTP we send some file parameters via SITE commands. These site parameters may be 'quote SITE sbd=.........' or 'cylinders pri=1 sec=1'. These types of parameters, we were passing using SITE commands in case of simple FTP. I think these parameters are specific to MVS system & without these parameters we can not upload/download files from MVS system.

For simple FTP we were using jakarta's commons.net API's methods FTPClient.sendSiteParameters().

But if I want to upload/download files from MVS thru SFTP then how can I achieve this task. Since SFTP is secured version of FTP so there should be some workaround to achieve such task. Please let me know how can I achieve this task?.

Thanks & Rregards
Brij

Atsuhiko Yamanaka <***@jcraft.com> wrote: Hi,

+-From: brijesh kadecha --
|_Date: Fri, 14 Jul 2006 03:08:53 -0700 (PDT) ______
|
| Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

On the sftp protocol, SITE command is not defined, unfortunately.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/



---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.


---------------------------------
Do you Yahoo!?
Next-gen email? Have it all with the all-new Yahoo! Mail Beta.
Oberhuber, Martin
2006-07-17 12:45:58 UTC
Permalink
Hi Brij,

I have only done forwardings through the commandline openSSH so far:

ssh -L 21:build.eclipse.org:21 -l moberhuber build.eclipse.org

Given that you have ssh access as ***@build.eclipse.org,
this will forward port 21 for you (the FTP port).

Locally, you can now do
ftp localhost
and it will forward the connection such that you really do FTPS on build.eclipse.org

I suppose that ssh -L is the equivalent of jsch portForwardL.
See the openSSH docu for more info on port forwarding.

HTH,
Martin
--
Martin Oberhuber - WindRiver, Austria
+43(662)457915-85





________________________________

From: jsch-users-***@lists.sourceforge.net [mailto:jsch-users-***@lists.sourceforge.net] On Behalf Of brijesh kadecha
Sent: Monday, July 17, 2006 1:58 PM
To: jsch-***@lists.sourceforge.net
Subject: Re: [JSch-users] How to upload/download files from MVS system.


Hi Martin,
Thanks for help.

I guess FTP over SSH is also known as FTPS?. Presently we are using commons.net APIs of Jakarta for FTP.

Can you plz guide me how can I do PortForwarding? I saw there are 2 examples, PortForwardingL & PortForwardingR (But I dont know difference between them).
Presently I m directly calling FTPClient.connect(), FTPClient.storeFile() etc methods. Where FTPClient is API of Jakarta. Plz guide me how can I achieve ssh Port forwarding?

Thanks & Regards
Brij

"Oberhuber, Martin" <***@windriver.com> wrote:

Hi Brij,

you are misunderstanding. SFTP is _not_ just a secured version of FTP, it is something different.

I see two alternatives for you:

a) Get an ssh server for MVS that supports standard sftp (not sure if such a server exists).

b) Instead of SFTP, use FTP-over-ssh. It works like this:
* ssh does port forwarding of port #21 through its secure connection
* you use a standard FTP client to access the standard MVS FTP server - but through the forwarded port


When I remember right, you were writing your own Java FTP client -- adding jsch port forwarding to that
client should be easy to do.
Cheers,
Martin
--
Martin Oberhuber - WindRiver, Austria
+43(662)457915-85




________________________________

From: jsch-users-***@lists.sourceforge.net [mailto:jsch-users-***@lists.sourceforge.net] On Behalf Of brijesh kadecha
Sent: Monday, July 17, 2006 8:42 AM
To: jsch-***@lists.sourceforge.net
Subject: Re: [JSch-users] How to upload/download files from MVS system.


Hi,
Thanks for reply.

If SFTP protocol does not support 'SITE' command then how can we upload/download files from MVS system?. I thought SFTP provides all functionality of FTP protocol but additionaly provides secured communication.

While FTP we send some file parameters via SITE commands. These site parameters may be 'quote SITE sbd=.........' or 'cylinders pri=1 sec=1'. These types of parameters, we were passing using SITE commands in case of simple FTP. I think these parameters are specific to MVS system & without these parameters we can not upload/download files from MVS system.

For simple FTP we were using jakarta's commons.net API's methods FTPClient.sendSiteParameters().

But if I want to upload/download files from MVS thru SFTP then how can I achieve this task. Since SFTP is secured version of FTP so there should be some workaround to achieve such task. Please let me know how can I achieve this task?.

Thanks & Rregards
Brij

Atsuhiko Yamanaka <***@jcraft.com> wrote:

Hi,

+-From: brijesh kadecha --
|_Date: Fri, 14 Jul 2006 03:08:53 -0700 (PDT) ______
|
| Actually I am interested in 'SITE' command of original FTP protocol for SFTP. Which method of JSch API can be used for it & how? OR which command of SFTP is equivalent to it & which is corresponding method in JSch API?

On the sftp protocol, SITE command is not defined, unfortunately.


Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/



________________________________

Yahoo! Messenger with Voice. Make PC-to-Phone Calls <http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com> to the US (and 30+ countries) for 2¢/min or less.



________________________________

Do you Yahoo!?
Next-gen email? Have it all with the all-new Yahoo! Mail Beta. <http://us.rd.yahoo.com/evt=42241/*http://advision.webevents.yahoo.com/handraisers>
Loading...