[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

using ssh to tunnel a ftp connection



Hi,

i have a problem using ssh to tunnel ftp. I tried using it from a winbox to connect to a linux server running sshd en wu-ftpd.

When i use the SSH Secure Shell Client program to connect to the server and setup a tunnel, i can then succesfully use smartftp to connect to localhost and have that tunneled to the wu-ftp server.
The setup of a tunnel in SSH Secure Shell Client lets you choose between tcp and ftp as type. I choose ftp and then I used local connection to port 6002 and 21 as remote port.
However, when i try to accomplish the same via commandline (using cygwin & ssh) it fails.
I see smartftp connecting without a problem until it opens another port.
This is what happens:
"200 Type set to A.
    PASV
227 Entering Passive Mode (192,168,1,12,16,239)
    Opening data connection IP: 192.168.1.12 PORT: 4335.
    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
    PORT 127,0,0,1,11,54
502 Illegal PORT Command"

I also use a private/public key pair so i don't have to type the password.
The commandline ssh command i use is this:
ssh -1 -p 2000 -i a:\private.key username@server -L 6002:server:21

I have even tried to use the root user instead of a regular user but this doesn't make a difference. Neither does using the -g option.
I want to be able to do this from the commandline since i can then issue this command from within a java application that i'm building that uses ftp.

What do i have to change to this command to have it work as SSH Secure Shell Client?

Thanks for any info,
Benedict



Reply to: