title: Execute multiple CLI commands via ssh2_exec in the same shell
body: <p>I've been trying to execute two or more commands on a remote device by using PHP's ssh2_exec command but it doesn't seem to be able to execute a command, wait for a response and execute another one.</p>
  
  <p>The second command that I need to run must be in the context of the first command so it must be executed in the same shell. What I mean is something like this</p>
  
  <pre><code>FWEFW # config system admin
  </code></pre>
  
  <p>This command will take me into a "context". The result will be something like:</p>
  
  <pre><code>FWEFW (admin) # 
  </code></pre>
  
  <p>From here, I'd like to run a second command that could set the password or another field of <strong>(admin)</strong></p>
  
  <pre><code>FWEFW (admin) # set password 'abcde'
  </code></pre>
  
  <p>Here's what I've tried so far:</p>
  
  <pre><code>$stream = ssh2_exec($con, 'config system admin');
  stream_set_blocking($stream, TRUE);
  $output = ssh2_fetch_stream($stream, SSH2_STREAM_STDIO);
  
  // After this, what can I do to stay in the same shell and execute the second command after "config system admin"?
  </code></pre>