ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: secure FTP
Date Tue, 19 Nov 2002 14:54:02 GMT
This is a post from commons-user that might be of help: --DD

-----Original Message-----
From: Benedict Verheyen [] 
Sent: Tuesday, November 19, 2002 4:56 AM
Subject: Re: [net.ftp] secure ftp (probably off topic)

>From: Hu <>
>Reply-To: "Jakarta Commons Users List" <>
>To: Jakarta Commons Users List <>
>Subject: Re: [net.ftp] secure ftp (probably off topic)
>Date: Mon, 18 Nov 2002 16:54:00 -0800 (PST)
>I could not find any in both of the sites. which part
>of has ssh? I am looking for secure
>file transfer in java too.

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:

2.3.2. jsch
Somewhere on that page is a link to
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

If you are working on windows and you need a windows ssh server/commandline 
client, take a look at:

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 [] 
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


-----Original Message-----
From: Eduardo Andrés Alfonso Sierra []
Sent: Monday, November 18, 2002 3:39 PM
To: Ant Users List
Subject: secure FTP


I wanna know if there's a task that allows me to send files (ftp way) to
servers wich require secure connections. (SSH)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message