title: phpseclib - attempting to connect to an HP procurve switch returns error: SSH command execution is not supported
body: <p>i'm trying to use phpseclib's NET_SSH2 library to connect to an HP switch. 
  just to test / get started, i'm trying to log on, and then run a 'show interfaces brief' command on the switch. 
  But after it logs me on, i get an error message : </p>
  
  <pre><code> SSH command execution is not supported. 
  </code></pre>
  
  <p>here's the code: </p>
  
  <pre><code>&lt;?php
  set_include_path(get_include_path() . PATH_SEPARATOR . '../phpseclib');
  include('Net/SSH2.php');
  define('NET_SSH2_LOGGING', true); //turn on logging.
  
  $ssh = new Net_SSH2('10.10.10.10'); //starting the ssh connection to localhost
  if (!$ssh-&gt;login('', 'password')) { //if you can't log on...
    exit('Login Failed');
  }
  else  {
  echo 'logged in&lt;br&gt;';
  }
  echo 'Attempting command: &lt;br&gt;';
  $output = $ssh-&gt;exec('show interfaces brief');    
  echo $output.'&lt;br&gt;';
  echo 'Error message is: &lt;br&gt;';
  $log = $ssh-&gt;getLog(NET_SSH2_LOG_COMPLEX);
  foreach ($log as $logitem)  {
  echo $logitem.'&lt;br&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>The output that this returns is: </p>
  
  <pre><code> logged in
   Attempting command:
  
   Notice: Connection closed prematurely in /var/www/phpseclib/Net/SSH2.php on line 1941
   SSH command execution is not supported.
   Error message is:
   &lt;-
   -&gt;
   &lt;- NET_SSH2_MSG_KEXINIT (0.0015s)
   -&gt; NET_SSH2_MSG_KEXINIT (0s)
   -&gt; NET_SSH2_MSG_KEXDH_INIT (0s)
   &lt;- NET_SSH2_MSG_KEXDH_REPLY (0.5123s)
   -&gt; NET_SSH2_MSG_NEWKEYS (0s)
   &lt;- NET_SSH2_MSG_NEWKEYS (0s)
   -&gt; NET_SSH2_MSG_SERVICE_REQUEST (0s)
   &lt;- NET_SSH2_MSG_SERVICE_ACCEPT (0.1962s)
   -&gt; NET_SSH2_MSG_USERAUTH_REQUEST (0.0001s)
   &lt;- NET_SSH2_MSG_USERAUTH_BANNER (0.0014s)
   &lt;- NET_SSH2_MSG_USERAUTH_SUCCESS (0.0392s)
   -&gt; NET_SSH2_MSG_CHANNEL_OPEN (0s)
   &lt;- NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION (0.0204s)
   -&gt; NET_SSH2_MSG_CHANNEL_REQUEST (0s)
   &lt;- NET_SSH2_MSG_CHANNEL_SUCCESS (0.1011s)
   &lt;- NET_SSH2_MSG_CHANNEL_DATA (0s)
   -&gt; NET_SSH2_MSG_CHANNEL_DATA (0s)
   &lt;- NET_SSH2_MSG_CHANNEL_EOF (0s)
   &lt;- NET_SSH2_MSG_CHANNEL_REQUEST (0s)
   &lt;- NET_SSH2_MSG_CHANNEL_CLOSE (0s)
  
   Notice: Connection closed prematurely in /var/www/phpseclib/Net/SSH2.php on line 1941
  </code></pre>
  
  <p>Line 1941 in ssh2.php is the "user_error" line you see below:</p>
  
  <pre><code> function _send_binary_packet($data)
  {
      if (feof($this-&gt;fsock)) {
          user_error('Connection closed prematurely', E_USER_NOTICE);
          return false;
      }
  </code></pre>
  
  <p>What I've done so far: </p>
  
  <ol>
  <li>I've logged in manually via ssh and made sure that I can run the same command.</li>
  <li>i've gone through the switch's web config page to make sure there's nothing else I need to turn on etc. for ssh.</li>
  <li>I've been checking phpseclib's forums for any similar issues. </li>
  </ol>
  
  <p>I'm using version 1.53 2010/10/24 01:24:30 of the phpseclib. </p>
  
  <p>Any help would be appreciated.  Thanks.</p>