title: How to run the sftp command with a password from Bash script?
body: <p>I need to transfer a log file to a remote host using <a href="http://en.wikipedia.org/wiki/Secure_file_transfer_program" rel="noreferrer">sftp</a> from a Linux host. I have been provided credentials for the same from my operations group. However, since I don't have control over other host, I cannot generate and share RSA keys with the other host. </p>
  
  <p>So is there a way to run the <code>sftp</code> command (with the username/password provided) from inside the Bash script through a <a href="http://en.wikipedia.org/wiki/Cron" rel="noreferrer">cron</a> job?</p>
  
  <p>I found a similar Stack Overflow question, <em><a href="https://stackoverflow.com/questions/5268865">Specify password to sftp in a Bash script</a></em>, but there was no satisfactory answer to my problem.</p>