hi,
i have php script to connect MK and execute same commands. this script work with 2.x 3.x 4.x but not with 5betaX
script execute command, but then stoping - dont execute(write) echo “ssh2_exec finished\n”;
and echo “end script”;
can anyone help me whe is problem ?
(ssh2-0.11.0.tgz libssh2-1.1.tar.gz)
$methods = array('kex' => 'diffie-hellman-group1-sha1');
$connection = ssh2_connect('1.2.3.3', 22, $methods);
if ($connection) {
echo "connection OK\n\n";
if (ssh2_auth_password($connection, 'admin', 'passwd')) {
echo "auth OK\n";
$s = ssh2_exec($connection, '/export file=backup');
sleep(2);
echo "ssh2_exec finished\n";
fclose($s);
}
else {
echo "auth FAIL\n";
}
}
else {
echo "connection FAIL\n\n";
}
echo "end script\n";