title: Can't execute git command in nodejs
body: <p>I can successfully execute <code>git pull</code> in linux command line on my VPS, but when I execute a bash file containing "<code>git pull</code>" with execFile in Nodejs, it gave me an error: <code>Command failed: Host key verification failed.</code> How can I solve this problem? </p>
  
  <p>Update: 
  The whole error message I get is: </p>
  
  <pre><code>{ [Error: Command failed: Host key verification failed. fatal: Could not read 
  from remote  repository. Please make sure you have the correct access rights
  and the repository exists. ] killed: false, code: 1, signal: null }
  </code></pre>
  
  <p>It seems that it's not the same problem with the question dylants provided.</p>
  
  <p>The bash file script is like this, I use it to auto deploy my nodejs app:</p>
  
  <pre><code>git pull &amp;&amp; pm2 reload www
  </code></pre>
  
  <p>I am using ssh protocol instead of https protocol on my vps in order to prevent the password prompt each time I <code>git pull</code> from my bitbucket repository. So ssh keys were generated in my user directory <code>~/.ssh/</code>. I think the reason why nodejs failed to execute the bash file is this:  The user who run the bash file in nodejs app is different from the user who run the bash file in command line. so the user running nodejs can't use the ssh keys located in <code>~/.ssh</code> for verification. </p>
  
  <p>Is that right? How to fix it?</p>