There are several ways you can accomplish this:From: Hu <[EMAIL PROTECTED]> Reply-To: "Jakarta Commons Users List" <[EMAIL PROTECTED]> To: Jakarta Commons Users List <[EMAIL PROTECTED]> 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
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
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>