Guest User

Untitled

a guest
Mar 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $output = ssh2_exec($sshCon, $sshCommand);
  2.  
  3. stream_set_blocking($output, true);
  4.  
  5. echo stream_get_contents($output);
  6.  
  7. <?php
  8. include('Net/SSH2.php');
  9.  
  10. $ssh = new Net_SSH2('www.domain.tld');
  11. if (!$ssh->login('username', 'password')) {
  12. exit('Login Failed');
  13. }
  14.  
  15. echo $ssh->exec($sshCommand);
  16. ?>
  17.  
  18. $output = ssh2_exec($sshCon, $sshCommand);
  19.  
  20. stream_set_blocking($output, true);
  21.  
  22. while($line = fgets($output)) {
  23. echo $line;
  24. }
Add Comment
Please, Sign In to add comment