This is a post from commons-user that might be of help: --DD
-----Original Message-----
From: Benedict Verheyen [mailto:wsbenedictv@hotmail.com]
Sent: Tuesday, November 19, 2002 4:56 AM
To: commons-user@jakarta.apache.org
Subject: Re: [net.ftp] secure ftp (probably off topic)
>From: Hu <xwhu_1999@yahoo.com>
>Reply-To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
>To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
>Subject: Re: [net.ftp] secure ftp (probably off topic)
>Date: Mon, 18 Nov 2002 16:54:00 -0800 (PST)
>
>Hi,
>I could not find any in both of the sites. which part
>of www.eclipse.org has ssh? I am looking for secure
>file transfer in java too.
>Thanks
There are several ways you can accomplish this:
1. use sftp from within your source.
2. use a regular ftp class but first setup a secure tunnel:
2.1. with ssh commandline
2.2. with a ssh client program
2.3. from within your source.
Option 1 is probably the easiest to accomplish. You can execute these
commands via
Process p = Runtime.getRuntime().exec( strCommand );
where strCommand is the commannd you want to execute.
Option 2.1.
Using ssh commandline commands you can setup the tunnel before you issue an
ftp command. For instance:
ssh -p 2000 -i private.key user@remotehost -L 21:remotehost:21
would connect to a sshd server on port 2000 as user using a private key and
setup a tunnel for ftp.
Option 2.2. Is also pretty easy but requires the users of the program
to do an additional step: they have to start the ssh client that sets up the
ftp tunnel. Clients that can be used are mindterm (java client), putty, ...
Option 2.3. Can be accomplished by using one of these (this isn't a definate
list but the thins i found)
2.3.1. mindterm has a jar that you can use in your program. have a look at
the license though:
http://www.appgate.com/mindterm/
2.3.2. jsch
http://www.jcraft.com/jsch/index.html
Somewhere on that page is a link to jsch-0.0.8.zip.
This contains the sourece. You'll need to compile the source yourself and
then pack it in a jar if you want.
2.3.3. ssh-tools
http://sshtools.sourceforge.net
If you are working on windows and you need a windows ssh server/commandline
client, take a look at: http://www.networksimplicity.com/openssh/
I used it to test my ssh and it works great.
Also, before you start using your tunneled ftp service in a program, it
might be a good idea to first accomplish the same using a ssh client and an
ftp program. That way, you'll be sure that the connection works before you
start coding away.
Hope this helps
Benedict Verheyen
-----Original Message-----
From: Nathan Christiansen [mailto:Nathan_Christiansen@morinda.com]
Sent: Monday, November 18, 2002 6:30 PM
To: Ant Users List; Eduardo Andrés Alfonso Sierra
Subject: RE: secure FTP
Alas, it does not exist.
I asked the same question and the response was "Would you like to implement
it?"
See:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13663
-----Original Message-----
From: Eduardo Andrés Alfonso Sierra [mailto:edalfon@lycos.co.uk]
Sent: Monday, November 18, 2002 3:39 PM
To: Ant Users List
Subject: secure FTP
Hi
I wanna know if there's a task that allows me to send files (ftp way) to
servers wich require secure connections. (SSH)
Thanks!!
--
To unsubscribe, e-mail: <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
|