Free SFTP client code for Mac? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- AnthonyTekatch · 2021-12-30 23:56 Is there a free SFTP client code/example that can be used in Lazarus/Freepascal on a Mac? ---------------------------------------------------------------------- trev · 2021-12-31 01:15 Apple does not have an API for either FTPS or SFTP, although on macOS you may be able to make some headway by invoking the sftp command-line tool. ---------------------------------------------------------------------- AnthonyTekatch · 2021-12-31 02:25 Quote from: trev on December 31, 2021, 02:15:32 amApple does not have an API for either FTPS or SFTP, although on macOS you may be able to make some headway by invoking the sftp command-line tool. I did get the command line running with Runncommand using the keygen password-free method, but in this case I need to sign into a server that I do not have the ssh key for and pass along the password to sftp. And, I read that it is frowned upon to be sending text passwords on the command line. I suppose I can use the TProcess method for sending the password when asked. ---------------------------------------------------------------------- PierceNg · 2021-12-31 02:40 Quote from: AnthonyTekatch on December 31, 2021, 12:56:48 amIs there a free SFTP client code/example that can be used in Lazarus/Freepascal on a Mac? Github lists three Delphi wrappers for libssh2. Not clear whether they work with FPC but good for reference if you are handy with FPC FFI. https://github.com/topics/libssh2?l=pascallibssh2 is known to work on MacOS. ---------------------------------------------------------------------- AnthonyTekatch · 2022-01-02 02:00 Quote from: PierceNg on December 31, 2021, 03:40:20 amGithub lists three Delphi wrappers for libssh2. Not clear whether they work with FPC but good for reference if you are handy with FPC FFI. https://github.com/topics/libssh2?l=pascallibssh2 is known to work on MacOS. Thank you for your suggestion.  I'm not handy with FPC FFI, but I'll read about it anyway. ---------------------------------------------------------------------- rvk · 2022-01-02 15:39 If you can get LibSSH2 for the mac working (like PierceNg mentioned) you can start by looking at SimpleSFTP.pas from http://synapse.ararat.cz/files/contrib/ (download sftp.zip there). The 'problem' is that that one is using CryptLib (which isn't freely distributable). I've got a working example (attached) with SimpleSFTP.pas for libssh2.dll. I Tested it under Windows with test.rebex.net port 22. There are other SFTP test-sites for clients here: https://www.sftp.net/public-online-sftp-servers ---------------------------------------------------------------------- AnthonyTekatch · 2022-01-11 16:00 Thanks for your help, I will dig into that later. I took the easy way out for now and got expect to do the sftp password entry on Linux and a Mac: https://forum.lazarus.freepascal.org/index.php/topic,7610.msg430509.ht ml#msg430509