Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- $strServer = "*";
- $strServerPort = "*";
- $strServerUsername = "*";
- $strServerPassword = "*";
- //connect to server
- $resConnection = ssh2_connect($strServer, $strServerPort);
- if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword)){
- echo "connect ok";
- //Initialize SFTP subsystem
- $resSFTP = ssh2_sftp($resConnection);
- $resFile = fopen("ssh2.sftp://{$resSFTP}/mc/plugins/banned-ips.txt", 'r');
- $strData = fread($resFile);
- fclose($resFile);
- $strData = file_get_contents("ssh2.sftp://{$resSFTP}/mc/plugins/banned-ips.txt", 'r');
- }else{
- echo "Unable to authenticate on server";
- }
- ?>
Add Comment
Please, Sign In to add comment