title: How to make scp in Shell Script ask me for password
body: <p>I am making a script to securely transfer data between my two machines through <code>scp</code>.</p>
  
  <p>But in the script, it shows an error due to no password. So how can I make my shell script to ask me for password after executing <code>scp</code> command?</p>
  
  <p>Here is my <code>csh</code> script.</p>
  
  <pre><code># ssh shahk@sj-shahk
  # ls -al
  echo "Source Location of Remote Server - $1"
  echo "Destination Location of Local Server - $2"
  echo "File/Folder to be Transferred from Remote Server - $3"
  
  echo "File Transfer Starts"
  scp -rv $1/$3 &lt;username&gt;@&lt;hostname&gt;:$2
  echo "File Transfer Completed"
  
  # exit
  </code></pre>
  
  <p>Now I am using the above script with <code>ssh</code> in following way.</p>
  
  <pre><code>ssh &lt;username&gt;@&lt;hostname&gt; "&lt;script name&gt; &lt;args&gt;"
  </code></pre>
  
  <p>When I use in the above manner, it does not prompt for password while executing <code>scp</code> command.</p>