title: Execute SSH commands on Cisco router. Codeigniter SSH library
body: <p>I have a little problem. I'm using Codeigniter with SSH library written by Shuky (https://bitbucket.org/quicktips/codeigniter-ssh2-library/src/a444968345ba/SSH.php -- You can see the code by following this link).</p>
  
  <p>Everything related with SSH works fine with other devices, but when I try to use this library and execute commands on Cisco devices, nothing happens (commands are not executed). I know that the connection is successful, but I can't execute any commands.</p>
  
  <p>When I try to run and execute comands through SSH on Cisco devices I get this error:</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Warning
  
  Message: stream_set_blocking() expects parameter 1 to be resource, boolean given
  
  Filename: libraries/SSH.php
  
  Line Number: 128
  
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: fread() expects parameter 1 to be resource, boolean given
  
  Filename: libraries/SSH.php
  
  Line Number: 129
  </code></pre>
  
  <p>In the library these lines look like this:</p>
  
  <pre><code>       /**
   * Get stream data
   *
   * @access privte
   * @return bool
   */
  function _get_stream_data($stream) {
      stream_set_blocking( $stream, true );
      while( $buf = fread($stream,4096) ) {
          $this-&gt;data .= $buf.'~';
      }
      return TRUE;
  }    
  
  
  
  line 128 - stream_set_blocking( $stream, true );
  line 129 - while( $buf = fread($stream,4096) ) {
  </code></pre>
  
  <p>Maybe you guys know where the problem is?</p>
  
  <p>Thank you for your time and your answers!</p>