title: How to generate known_host file in windows machine
body: <p>I am using Jsch(Jcraft) library to establish a SSH connection with a SSH server as shown below :</p>
  
  <pre><code>        JSch jsch = new JSch();
          String user = "****";
          String host = "****";
          int port = 22;
          String privateKey = "***.ppk";//Path to private key(The file is in .ppk format)
          try 
          {
              jsch.addIdentity(privateKey);
              Session session = jsch.getSession(user, host, port);
              java.util.Properties config = new java.util.Properties(); 
              config.put("StrictHostKeyChecking", "no");
              session.setConfig(config);
              session.connect();
              ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp");
              sftpChannel.connect();
              /*file transfer code*/
              sftpChannel.disconnect();
              session.disconnect();
          }
          catch (Exception e) 
          {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>The SSH connection is successfully established as "StrictHostKeyChecking" is disabled. If its enabled I get the following error :</p>
  
  <pre><code>com.jcraft.jsch.JSchException: UnknownHostKey: ******. RSA key f
   is *************
          at com.jcraft.jsch.Session.checkHost(Session.java:805)
          at com.jcraft.jsch.Session.connect(Session.java:345)
          at com.jcraft.jsch.Session.connect(Session.java:183)
  </code></pre>
  
  <p>I understand we need to set know host file in the code as shown below :</p>
  
  <pre><code>jsch.setKnownHosts(knownHostsFileName); 
  </code></pre>
  
  <p>I am unable to generate known_hosts file via the command below :</p>
  
  <pre><code>ssh-keyscan &lt;HOST&gt; &gt; known_hosts 
  </code></pre>
  
  <p>It is throwing the following error :</p>
  
  <pre><code>'ssh-keyscan' is not recognized as an internal or external command,
  operable program or batch file.
  </code></pre>
  
  <p>I have only public and private keys in .ppk format. I dont have the known_host file.<br> How do we create known_host file? <br> Why is <strong>ssh-keyscan</strong> command throwing error - not recognized as internal/external command?</p>