title: ssh2_auth_pubkey_file authentication always fails
body: <p>I'm trying to connect to another machine using PHP's ssh2 functions. I know the ssh keys have been created with no passwords and are distributed correctly, I can <code>ssh user@host</code> in the terminal on my machine to the server.</p>
  
  <p>The PHP function tries to connect to a ip address using an ssh key file:-</p>
  
  <pre><code> function minnerConnect($miner_serial) {
  
      $port = '7822';
      $miner_ip = $this-&gt;getMinerIp($miner_serial);
  
      $methods = array(
          'kex' =&gt; 'diffie-hellman-group1-sha1',
          'hostkey' =&gt; 'ssh-dss',
          'client_to_server' =&gt; array(
              'crypt' =&gt; '3des-cbc',
              'mac' =&gt; 'hmac-md5',
              'comp' =&gt; 'none'),
          'server_to_client' =&gt; array(
              'crypt' =&gt; '3des-cbc',
              'mac' =&gt; 'hmac-md5',
              'comp' =&gt; 'none'));
      $connection = ssh2_connect($miner_ip, $port, $methods);
      if (ssh2_auth_pubkey_file($connection, 'root',
          '/root/.ssh/id_dsa.pub',
          '/root/.ssh/id_dsa','')) {
        echo "Public Key Authentication Successful\n";
      } else {
        echo "Public Key Authentication Failed";
      }
  </code></pre>
  
  <p>but the error shown is:-</p>
  
  <blockquote>
    <p>( ! ) Warning: ssh2_auth_pubkey_file(): Authentication failed for root using public key: Callback returned error in /var/www/application/models/miner_model.php on line 95</p>
  </blockquote>
  
  <p>line 95 is <code>'/root/.ssh/id_dsa','')) {</code>.</p>
  
  <p>Can anybody suggest a fix?</p>