SAP Knowledge Base Article - Public

3509849 - 'couldn't be established' error in SAP Datasphere when using Generic SFTP connection

Symptom

While setting up the Generic SFTP connection from SAP Datasphere to SFTP server, the following errors appears:

  • Connection <SFTP NAME> couldn't be established.
    - Data flows can't be used because of errors in the connection.
    - Replication flows are not supported.
    - Remote tables are not supported.
    Data Flows: Cause: Possible causes of error: Detailed error message (hostkey has been changed for remote host (<SFTP URL>))

  • Connection <SFTP NAME>  couldn't be established.
    - Data flows can't be used because of errors in the connection.
    - Replication flows are not supported.
    - Remote tables are not supported.
    Data Flows: Cause: Possible causes of error: Detailed error
    message connection is closed by foreign host)

"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."

Environment

  • SAP Datasphere
  • Generic SFTP

Cause

The SFTP hostkey is not set properly in SAP Datasphere.

Resolution

Generate the correct host key via the following steps:

Provide the host public key through a trusted channel. If your Windows 10, Linux, or MacOS machine has a trusted channel, perform the following steps by replacing the following elements with the specified values:
  • $HOST with the host name value of your connection

  • $PORT with the port value of your connection

Use the resulting file host_key.pub.txt, in the directory where you run the specified command, as the Host Key for your connection. The specified commands are as follows:
  • Windows 10: In PowerShell, run the following command:

    (ssh-keyscan -p $PORT $HOST 2>$null) -replace '^[^ ]* ','' > host_key.pub.txt

  • Linux/MacOS: In a unix-compliant shell with both ssh-keyscan and sed commands (both are installed in your system), obtain the key through the following command:

    ssh-keyscan -p $PORT $HOST 2>/dev/null | sed "s/^[^ ]* //" > host_key.pub.txt

See Also

See official documentation

Keywords

Sftp, ftp, protocol, matching, host, key, hostkey, pem, certificate, how, to generate, server , KBA , DS-DI-CON , Connections , Problem

Product

SAP Datasphere all versions