2

I need to use SpringBoot (2.7.x) SFTP Adapter (spring-integration-sftp) to estabilish SFTP file transfer over SSH tunnelling.

The solution i've found (based on SSH tunneling via JSch) is to create a SSH connection via JSch and then to use spring SFTP adapter to connect the JSch session via port forwarding, hence:

  1. JSch session between remotehost:22 and localhost:1234
  2. SFTP Adapter to localhost:1234

I'm wondering if there is some better/other way to achieve this for example with a proper configuration of Spring SFTP Adapter (some example?) or with some other Springboot library that gives this feature out of the box.

  • `spring-integration-sftp` already uses `JSch` under the hood. It looks like you're confusing ftp and sftp. These are completely different things and SFTP is not FTP-over-ssh – Nick Sep 19 '22 at 09:03
  • Sorry, it was my typos. I edited my answer. The connection i'm trying to estabilish over the SSH tunnel uses SFTP protocol. My question is precisely due to spring-integration-sftp is based on JSch and maybe there is some better way to do what described – Sergio Panico Sep 19 '22 at 09:39
  • Not sure if it does all you need but have you looked at Camel SFTP: https://camel.apache.org/components/3.18.x/sftp-component.html#_spring_boot_auto_configuration ? – grekier Sep 19 '22 at 11:45

0 Answers0