Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <html>
  2. <head><title>SSH</title></head>
  3. <style type="text/css">
  4.  
  5. body {font-family:airal , sans-serif , verdana;}
  6.  
  7. #ssh-ls {
  8.   width:auto
  9.   white-space: pre;
  10.   position:absolute;
  11.   left:450px;
  12.   letter-spacing:3px;
  13.   word-spacing:inherit;
  14. }
  15. </style>
  16. <body>
  17.    
  18. <?php
  19. include('Net/SSH2.php');
  20.  
  21. $user = 'john';
  22. $password = 123123;
  23.  
  24. $ssh = new Net_SSH2('192.168.40.132');
  25. if (!$ssh->login($user, $password)) {
  26.     exit('Login Failed');
  27. } else { echo 'hi dude <br />';}
  28. ?>
  29.  
  30. <div id="ssh-ls">
  31. <?php
  32. echo $ssh->exec('pwd');
  33. echo '<br />';
  34. echo nl2br($ssh->exec('ls -la'));
  35. echo $ssh->exec('whoami');
  36. ?>
  37.  
  38.  
  39. </div>
  40.  
  41.  
  42.  
  43. </body>
  44. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement