Skip to Content
Author's profile photo Pravesh Shukla

Generation of SFTP Known_Host File – Cloud Platform Integration

Introduction: Known Hosts is much like how the authorized_keys file is used to authenticate users the known_hosts file is used to authenticate servers. Whenever SSH is configured on a new server it always generates a public and private key for the server, just like you did for your user.


Procedure: You can generate known_host file by two methods.

  • By Command prompt/Cygwin(tool).
  • By Cloud Platform Integration.

In my case I will explain step by step solution through Command Prompt, as you same we have to follow it for Cygwin and after that I will explain you through Cloud Integration.

  • Command Prompt:
  1. Install OpenSSHD
  2. Start menu -> run -> cmd -> ssh –V (for checking successful installation of OpenSSHD).
  3. Run Command -> ssh-keyscan –t rsa host_url/ip_address -> file name.
  4. The file will be generated.(as mentioned path. example: I navigated it to the D: drive)

PFB the snapshot, Command Prompt screen should be like this:


Note: If you are generating known_host file for your internal server then it can create it with this procedure, because in my case I was creating it for third party SFTP and  I was able to generate known_host file but it was creating blank. If your file is creating blank follow Procedure 2.


  • Cloud Platform Integration:
  1. Open Cloud Platform Integration (tenant) through S user Id and Password.
  2. After Logged In Navigate to -> Monitoring -> Connectivity test.
  3. Select SSH Connectivity test PFB,



4) Enter the following SFTP Host URL and test it and Authentication is none and Click Send.

5) You will receive the Success Response, Click on the Copy Host Key.

6) Host Key will be copied to your clipboard, create a text file, paste that copied host key into text file.

7) Rename the file and remove its extension .txt.

8) Yes, this is now your known_host file.


Hope it helps!




Pravesh Shukla



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Good one using the built in connectivity check 🙂 I may add that the ones running Windows 10 with an appropriate version may also use WLX (Linux Subsystem) to query for the RSA Keys via "ssh-keyscan". See here how to get it

      Author's profile photo Pravesh Shukla
      Pravesh Shukla
      Blog Post Author

      Thanks Jens 🙂

      Author's profile photo Rajni Chellani
      Rajni Chellani

      Hi Jens,


      We have used the 2nd approach in CPI to get the host key for SFTP server. But we are receiving an below error.

      com.jcraft.jsch.JSchException: timeout: socket is not established


      Can you please help?




      Author's profile photo Pravesh Shukla
      Pravesh Shukla
      Blog Post Author

      Hi Rajni.


      This error states that there is something wrong with the connection.

      Please make sure host URL will be correct and accessible.



      Pravesh Shukla

      Author's profile photo Sailaja Battula
      Sailaja Battula

      Hi Rajni,


      I am also getting the same error.Can you please help me how you resolved this?




      Author's profile photo CPI Tenant5
      CPI Tenant5

      Where to upload this known hosts file now?