Thanks. It's not a complete fix but I think it's close --- at least the response is different. Unfortunately, I won't have time to dig further until tomorrow. It's probably a simple tweak at this point as I can now identify the 2 points it is endlessly looping between.
The first error is triggered in _get_channel_packet().
- Code: Select all
if ($response === false) {
user_error('Connection closed by server', E_USER_NOTICE);
return false;
}
Then it triggers this error in _get_binary_packet().
- Code: Select all
if (feof($this->fsock)) {
user_error('Connection closed prematurely', E_USER_NOTICE);
return false;
}
It then repeats those 2 errors endlessly.
I'm using a simplified script for testing this scenario.
- Code: Select all
include 'phpseclib0.2.2/Net/SSH2.php';
$ssh = new Net_SSH2('<ip_address>');
if (!$ssh->login(‘<username>’, '<password>')) {
exit('Login Failed');
}
ob_start();
$ret = $ssh->read('<hostname>#');
echo str_replace( "\r\n", "<br />", $ret );
ob_flush(); flush();
ob_end_flush();