EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SSH Tuneling

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#23449
Posted: 02/14/2013 13:45:13
by Andre Paradis (Standard support level)
Joined: 02/14/2013
Posts: 31

The idea is to do an SSH tunneling (like Putty) and then be able to run FTP command from any FTP program. FTPS or SFTP are not an option.

So I have use TElSSHClient with the TElLocalPortForwardSSHTunnel.
Then I have created ServerSocket to listen my local port and create the necessary thread, Open the Tunnel, Execute my thread to handle the communication. It doesn't work....

1. Do you have any example without Indy. The ServerSocket seems a little bit different.
2. The Tunnel get Close right after the Opening. I can see some information exchanged between teh SSH server and SSH Client after the tunnel opening, (I got nothing in the OnData event of the Tunnel), and then the Tunnel is closed.
#23450
Posted: 02/14/2013 13:47:34
by Andre Paradis (Standard support level)
Joined: 02/14/2013
Posts: 31

I forgot to tell you, I have forward the local port 21 to 21.
So I can readch the FTP using "locahost" as server name.
I should get at least the FTP Welcome message.
#23451
Posted: 02/14/2013 13:49:53
by Ken Ivanov (EldoS Corp.)

Andre,

Thank you for getting in touch with us.

The first and principal question is that is there anything that prevents you from using simple forwarding components and forces you to use low-level SSH components?
#23452
Posted: 02/14/2013 13:56:22
by Eugene Mayevski (EldoS Corp.)

Actually the very first question is how Andre will deal with data channel which is dynamic. Actually that would be the answer to the question of why low-level SSH components are needed - FTP commands must be intercepted and address/port for data channel should be altered.


Sincerely yours
Eugene Mayevski
#23453
Posted: 02/14/2013 13:59:34
by Ken Ivanov (EldoS Corp.)

Exactly - and that's particularly why the simple forwarding components are a preferred choice in this case.
#23454
Posted: 02/14/2013 14:07:07
by Andre Paradis (Standard support level)
Joined: 02/14/2013
Posts: 31

I'm open for any good suggestion...:)

The simple forwarding components is not working... I get connection "Connection Closed" actually, it seems to react exactly like my program, the tunnel is open then closed.

I'm using passive FTP, so when the routing will done on port 21, I will do the same on port 20, which should solve everything... It's the way I did it with Putty.
#23455
Posted: 02/14/2013 14:15:22
by Ken Ivanov (EldoS Corp.)

Andre,

OK, so let's try to make the simple forwarding components work. First, open the simple local forwarding sample and try to connect to your SSH server. Once connected, direct your FTP client to the local listening port. What exactly happens and what exactly is reported in the application log?

Quote
I'm using passive FTP, so when the routing will done on port 21, I will do the same on port 20, which should solve everything

This looks like an active, not passive mode (server connects to the client), isn't it?
#23456
Posted: 02/14/2013 14:22:31
by Andre Paradis (Standard support level)
Joined: 02/14/2013
Posts: 31

I get that in the string grid at the bottom:
Server key received
Authentification succeded
SSH Connection established
New secure channel opened
Secure channel closed
#23457
Posted: 02/14/2013 14:30:08
by Ken Ivanov (EldoS Corp.)

OK,

A couple of further questions to pinpoint the issue:

1) Is there any data reported as sent in the tunneled connection list view?

2) Are there any messages reported by the FTP client tool?

3) How exactly are you setting up the tunnel with Putty?
#23458
Posted: 02/14/2013 14:41:46
by Andre Paradis (Standard support level)
Joined: 02/14/2013
Posts: 31

1. No
2. I get "Unable to connect"
3. In Session, I have set the Host IP on Port 22.
In Connection/SSH/Tunnels,
Source POrt:21
Destination: Same as Host IP
So I get: L21 HostIP:21

While doing that in Putty on port 21 only, I get at least the FTP Welcome Message. This Welcome message is what I'm trying to get to know if it's working or not.
Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.

Reply

Statistics

Topic viewed 1819 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!