title: How to send password using sftp batch file
body: <p>I'm trying to download a file from sftp site using batch script. I'm getting the following error:</p>
  
  <pre><code>Permission denied (publickey,password,keyboard-interactive).
  Couldn't read packet: Connection reset by peer
  </code></pre>
  
  <p>When running  the command:</p>
  
  <pre><code>sftp -b /home/batchfile.sftp &lt;user&gt;@&lt;server ip&gt;:&lt;folder&gt;
  </code></pre>
  
  <p>the <code>batchfile.sftp</code> includes these data:</p>
  
  <pre><code>password
  lcd [local folder]
  cd [sftp server folder]
  get *
  bye
  </code></pre>
  
  <p>Note: It's working when running at the prompt as</p>
  
  <pre><code>sftp &lt;user&gt;@&lt;server ip&gt;:&lt;folder&gt;
  </code></pre>
  
  <p>But I need the ability to enter the password automatically.</p>