on 10-08-2024 08:02 AM
Switching the ContentConnector to SFTP mode doesn’t require any code changes, it can be done simply by modifying the ContentConnector.xml file as shown below.
Set the FTP URL parameter to sftp.cs.1worldsync.com under the /ContentConnector/DataFeedConfiguration/DS element. The modified element should look like this:
<DS Login="C98765" Password="abcd1234" FTPURL="sftp.cs.1worldsync.com"/> |
Uncomment or add the option “SecureFTP” under the /ContentConnector/DataFeedConfiguration element. The modified element should look like this:
<Option>SecureFTP</Option> <!--Downloads the files via SFTP (FTP over SSH)--> |
Now that the ContentConnector is configured to use SFTP, it will raise an error unless the environment is properly configured. To do this, the sftp fingerprint needs to be added to a known_hosts file, which can be achieved using a simple command line in any unix-like prompt.
Under Linux or Mac, any prompt can be used. Under Windows, you’ll need to use WSL, or alternatively you can install Git for Windows just to use the Git bash.
Within an appropriate shell, use cd commands to change the current directory to where the ContentConnector jar file is located. Once inside the right directory, add the host using the following command:
|
The above line will create a known_hosts in the same directory where the jar file is located, after which you can simply use the [path-to-java\]java -jar ContentConnector-2.2.22.jar command as usual since you’re already in the right directory.
⚠ If You’re having trouble generating a known_hosts file, you can download one from here that is valid at the time of writing this guide. It must be placed in the same directory as the ContentConnector‑X.Y.Z.jar file as per instructions above, before executing the java -jar command.
In Powershell you can also simply download the known_hosts file directly to the ContentConnector directory using these commands:
PS> $url = "https://drive.google.com/uc?export=download&id=1A1-HVhaAlvKTiZcqSN4dpp3PLFFhU934"
PS> Invoke-WebRequest -Uri $url -OutFile .\known_hosts
SFTP uses port 22. Ensure that outbound traffic is allowed to sftp.cs.1worldsync.com over this port. This may require contacting your domain administrator or changing firewall settings in the machine running the ContentConnector, or both.