[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Не могу пробросить SSH тунель
Страницы: 1, 2
GET
Цитата
Я обычно делаю еще проще. С помощью сервиса dyndns.org.


спасибо почитаю...

_____________
Не тот велик, кто не падал, а тот кто падал и поднимался.
AllesKlar
Может поможет.
правда, тут не тонель, а запуск bash скрипта по SSH
Но это живой рабочий код с боевого сервера
Сам лишнее сотри :)

		public function svn_checout($dbname, $dbuser, $mandantname)
{
$connection = ssh2_connect(SSH_HOST, SSH_PORT);
ssh2_auth_password($connection, SSH_USER, SSH_PASSWOR);
$sftp = ssh2_sftp($connection);

$script_str = "bash " . SITEPATH . CRW_INSTALL_SCRIPT . " -s " . VORLAGE_DB_HOST ." -d " . $dbname. " -u " . $dbuser . " -n " . $mandantname;
$stream = ssh2_exec($connection, $script_str);
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);

// Enable blocking for both streams
stream_set_blocking($errorStream, true);
stream_set_blocking($stream, true);

// Whichever of the two below commands is listed first will receive its appropriate output. The second command receives nothing

$output = stream_get_contents($stream);
$error = stream_get_contents($errorStream);
//echo "Output: " . $output;
//echo "<hr>";

// Close the streams

fclose($errorStream);
fclose($stream);
return true;
if($error != '')
{
return $error;
}
else
{
return true;
}

}
// svn_checout()


_____________
[продано копирайтерам]
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.