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:
-
$HOST with the host name value of your connection
-
$PORT with the port value of your connection
-
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
Keywords
Sftp, ftp, protocol, matching, host, key, hostkey, pem, certificate, how, to generate, server , KBA , DS-DI-CON , Connections , Problem
SAP Knowledge Base Article - Public