title: WinSCP script: Unknown command 'ssh-rsa'
body: <p>I have WinSCP script connecting to am SFTP site. It establishes connection and says "starting session" but exits.  </p>
  
  <p>This is my script <code>FilePull.txt</code>:</p>
  
  <pre><code>open sftp://***:****@sftp.****.com:22  -hostkey="
  ssh-rsa 1024 **********"
  </code></pre>
  
  <p>which is being called as:</p>
  
  <pre><code>Winscp.exe /console /script="C:\FilePull.txt" /log="C:\winscp.log" /loglevel=0
  </code></pre>
  
  <p>This is from <code>winscp.log</code>:</p>
  
  <pre><code>. 2019-05-04 18:27:28.626 Started a shell/command
  . 2019-05-04 18:27:28.626 --------------------------------------------------------------------------
  . 2019-05-04 18:27:28.626 Using SFTP protocol.
  . 2019-05-04 18:27:28.626 Doing startup conversation with host.
  &gt; 2019-05-04 18:27:28.626 Type: SSH_FXP_INIT, Size: 5, Number: -1
  &lt; 2019-05-04 18:27:28.739 Type: SSH_FXP_VERSION, Size: 5, Number: -1
  . 2019-05-04 18:27:28.739 SFTP version 3 negotiated.
  . 2019-05-04 18:27:28.739 We believe the server has signed timestamps bug
  . 2019-05-04 18:27:28.739 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
  . 2019-05-04 18:27:28.739 Getting current directory name.
  . 2019-05-04 18:27:28.739 Getting real path for '.'
  &gt; 2019-05-04 18:27:28.739 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
  &lt; 2019-05-04 18:27:28.771 Type: SSH_FXP_NAME, Size: 23, Number: 16
  . 2019-05-04 18:27:28.771 Real path is '/'
  . 2019-05-04 18:27:28.771 Startup conversation with host finished.
  &lt; 2019-05-04 18:27:28.771 Script: Active session: [1] vendor-pip@sftp.rcnlv.com
  &gt; 2019-05-04 18:27:28.771 Script: ssh-rsa 1024 d9:4a:5d:aa:88:4b:7d:b0:62:33:f8:7a:aa:21:c2:33
  &lt; 2019-05-04 18:27:28.772 Script: ssh-rsa 1024 d9:4a:5d:aa:88:4b:7d:b0:62:33:f8:7a:aa:21:c2:33
  &lt; 2019-05-04 18:27:28.772 Script: Unknown command 'ssh-rsa'.
  . 2019-05-04 18:27:28.772 Script: Failed
  . 2019-05-04 18:27:28.772 Script: Exit code: 1
  . 2019-05-04 18:27:28.772 Closing connection.
  </code></pre>
  
  <p>It should connect to SFTP site and get the files.</p>