Guest User

Untitled

a guest
May 18th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4. $strServer = "*";
  5. $strServerPort = "*";
  6. $strServerUsername = "*";
  7. $strServerPassword = "*";
  8.  
  9. //connect to server
  10. $resConnection = ssh2_connect($strServer, $strServerPort);
  11.  
  12. if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword)){
  13.     echo "connect ok";
  14.     //Initialize SFTP subsystem
  15.     $resSFTP = ssh2_sftp($resConnection);
  16.     $resFile = fopen("ssh2.sftp://{$resSFTP}/mc/plugins/banned-ips.txt", 'r');
  17.    
  18. $strData = fread($resFile);
  19. fclose($resFile);
  20. $strData = file_get_contents("ssh2.sftp://{$resSFTP}/mc/plugins/banned-ips.txt", 'r');
  21.  
  22. }else{
  23.     echo "Unable to authenticate on server";
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment