host key verification error in jenkins build
<p>I have a jenkins project that uses the ssh-agent module to use my personal key... to ssh into a remote box and run some commands. 
I've added my personal id / key information to the global "jenkins" scope or user??
(basically, i go to Home page, Credentials, clicked on the "add credentials" to the "jenkins" object listed... and then added my key information). </p>

<p>The build includes the following shell command: </p>

<pre><code>ssh -t -t root@10.1.2.3 lua /var/www/widgets/test_widget.lua
</code></pre>

<p>On my dev server (running ubuntu), this project works.  It logs into the remote server, runs the above command and displays the results. </p>

<p>On my production server, I get the following error: </p>

<pre><code> Host key verification failed.
</code></pre>

<p><strong>What I 've Tried</strong></p>

<ol>
<li>made sure the project on the dev box and production box are configured exactly the same way. </li>
<li>made sure my key has been entered properly in production , aka the same way as on dev</li>
<li>i manually logged into the jenkins server... and then from there I tried to ssh into the 10.1.2.3 box and I don't get any errors. </li>
<li>on the jenkins server's known_hosts file, I removed the 10.1.2.3 entry and retried... but the build still fails. </li>
<li>Made sure the production server has the same ssh plug ins installed as my dev server. </li>
</ol>

<p>I'm not sure what else to try. </p>

<p><strong>EDIT</strong></p>

<p>I found an interesting artifact on the actual jenkins server: </p>

<pre><code>jenkins-server1:~# ssh-keyscan 10.1.2.3 &gt;&gt; /root/.ssh/known_hosts
# 10.1.2.3 SSH-2.0-OpenSSH_6.8p1-hpn14v4
</code></pre>

<p>So I edit the file using vim and save changes.
And then I retry the scan and the entry is still there!  So it's not a problem with Jenkins... but something with that file itself. </p>