
Untitled
By: a guest on
Aug 6th, 2012 | syntax:
None | size: 1.64 KB | hits: 13 | expires: Never
unable to connect using SSH2
1 require("Net/SSH2.php");
2
3 if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
4
5 $ssh = new Net_SSH2('***'); // the host IP address
6
7 if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method!");
8
9 if (!$ssh->login('***', '***')) { // (verified) username and password
10 echo "LOG: " . $ssh->getLog() . "<br>";
11 exit('Login failed!');
12 }
1 require("Net/SSH2.php");
2
3 define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);
4
5 if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
6
7 $ssh = new Net_SSH2('***'); // the host IP address
8
9 if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method!");
10
11 if (!$ssh->login('***', '***')) { // (verified) username and password
12 echo "LOG: " . $ssh->getLog() . "<br>";
13 echo "ALL ERRORS: ";
14 print_r($ssh->getErrors());
15 echo "<br>LAST ERROR: " . $ssh->getLastError() . "<br>";
16 exit('Login failed!');
17 }
if (!class_exists('Net_SSH2')) die("Class Net_SSH2 doesn't exist!");
if (!method_exists($ssh, 'Net_SSH2')) die("Net_SSH2 class doesn't have Net_SSH2 method");
if( !class_exists('Net_SSH2')...
echo $ssh->getLog();
define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX);
error_reporting(E_USER_NOTICE);
error_reporting(E_USER_NOTICE);
user_error('zzzz', E_USER_NOTICE);
error_reporting(0);
user_error('zzzz', E_USER_NOTICE);