Recent

Author Topic: How to connect Lazarus app to SFTP Server with public IP  (Read 6621 times)

eddy16391

  • New member
  • *
  • Posts: 9
How to connect Lazarus app to SFTP Server with public IP
« on: November 15, 2018, 02:40:16 pm »
Hi everybody,
I'm trying to write an app that send a zip file to a SFTP server with public IP address.
I've installed INDY platform but I can't understand how to use it.
Anyone know how to do it or have a link to a guide?
Thank you.

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: How to connect Lazarus app to SFTP Server with public IP
« Reply #1 on: November 18, 2018, 09:34:30 pm »
According to this https://stackoverflow.com/questions/4235714/ftp-over-ssh-sftp-in-delphi-2010 you can't, since SFTP (which is not the same as FTP over SSL/TLS) is not supported in Indy.
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: How to connect Lazarus app to SFTP Server with public IP
« Reply #2 on: November 19, 2018, 09:42:18 pm »
I'm trying to write an app that send a zip file to a SFTP server with public IP address.
I've installed INDY platform but I can't understand how to use it.
Anyone know how to do it or have a link to a guide?

By SFTP, are you referring to:

- actual SFTP (file transfer subset of SSH)
- FTP over SSH
- FTP over SSL/TLS

?

Many people get them mixed up, but they are completely different and unrelated protocols.  Of the three, Indy supports only FTP over SSL/TLS at this time.  It does not support SSH at all.

To use FTP over SSL/TLS in Indy, you can assign a TIdSSLIOHandlerSocketBase-derived component to the TIdFTP.IOHandler property, and then you can set the TIdFTP.UseTLS property to utUseImplicitTLS or utUseExplicitTLS as needed, and set the TIdFTP.DataPortProtection property to ftpdpsPrivate.
« Last Edit: November 19, 2018, 09:46:23 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: How to connect Lazarus app to SFTP Server with public IP
« Reply #3 on: November 19, 2018, 11:35:57 pm »
You could try to do it with Synapse in combination with libssh2.

I had some working code somewhere.
https://forum.lazarus.freepascal.org/index.php/topic,28053.msg178389.html#msg178389

 

TinyPortal © 2005-2018