Connecting to SSH FTP using Indy 10

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Kenny1981
Posts: 4
Joined: Wed 25 Apr 2012 21:21

Connecting to SSH FTP using Indy 10

Post by Kenny1981 » Wed 25 Apr 2012 21:35

We have used Indy 10 in Delphi XE to connect to FTP servers to upload and download files. One of our clients has an FTP server with SSH2 encryption, so we are trying to use SecureBridge to handle this. I can get the SSHClient demo to connect to the server, but when I try to use the product within our code, attaching it to the Indy component, I get a "Connection Failed" error. I am connecting a TScIdIOHandler to the TIdFTP object. I have an TScSSHClient connected to the IOHandler, and a TScFileStorage connected to the SSHClient. I had to set the OnServerKeyValidate event to get past an authentication issue, but then I started getting this error.

I'm new to using SecureBridge and connecting to SSH in general, so I might be missing something obvious, but I can't tell what it might be from the help files and the demos. Is there a demo or code sample on how to properly connect to an Indy component that allows us to upload and download using that component?

snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

Re: Connecting to SSH FTP using Indy 10

Post by snorkel » Mon 30 Apr 2012 21:03

You don't need to use Indy,
just use the SFTP component of Securebridge.

You can't secure regular FTP with SSH, The FTP server you are using must have a SFTP module which is entirely different than FTP, FTP works over several ports and might even be configured to have the data channel work over a range of ports. SFTP works over a single port, usually port 22.

Just take a look at the SFTP demo that ships with SB.

If you have to use INDY, then you have to have the FTP server configured to use FTPS which is FTP over SSL, again totally different than the SSH SFTP over port 22.

Kenny1981
Posts: 4
Joined: Wed 25 Apr 2012 21:21

Re: Connecting to SSH FTP using Indy 10

Post by Kenny1981 » Wed 02 May 2012 16:04

I suspected that might be the problem. Thank you for confirming it. I am attempting to do as you suggest. I am able to connect, but when I try to use the SFTP component to download, I get a "Timeout expired, server have not responded" error. I get this same error in the SSHClient demo, when it tries to call the SFTP.OpenFolder procedure. I opened a separate thread for this issue, and tried to contact DevArt support, but haven't had much luck.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Connecting to SSH FTP using Indy 10

Post by Dimon » Thu 03 May 2012 10:01

We have answered you in the forum. Please view the following topic: http://forums.devart.com/viewtopic.php?p=80835

Post Reply