par
the_grinch » 24 août 2008, 20:03
Oki , j'ai fais ceci :
<?php
$connection = ssh2_connect('crocamis.fr', 22);
if (ssh2_auth_password($connection, 'sab', 'sab'))
{
echo "Connection etablie !<br><br>";
if (ssh2_exec($connection, 'mkdir /home/sab/aze'))
{
echo "ssh2_exec oki !<br>";
$varcommandessh = ssh2_exec($connection, 'mkdir /home/sab/aze');
$handle = ssh2_fetch_stream($varcommandessh, SSH2_STREAM_STDERR);
if ($handle)
{
echo "ssh2_fetch_stream OK";
$varfread = fread($handle, 8192);
echo $varfread;
}
else
{
echo "pas de ssh2_fetch_stream";
}
}
else
{
echo "ssh2_exec echec<br>";
}
}
else
{
echo "Authentication Failed...<br>";
}
?>
ça me retourne :
Oki , j'ai fais ceci :
[php] <?php
$connection = ssh2_connect('crocamis.fr', 22);
if (ssh2_auth_password($connection, 'sab', 'sab'))
{
echo "Connection etablie !<br><br>";
if (ssh2_exec($connection, 'mkdir /home/sab/aze'))
{
echo "ssh2_exec oki !<br>";
$varcommandessh = ssh2_exec($connection, 'mkdir /home/sab/aze');
$handle = ssh2_fetch_stream($varcommandessh, SSH2_STREAM_STDERR);
if ($handle)
{
echo "ssh2_fetch_stream OK";
$varfread = fread($handle, 8192);
echo $varfread;
}
else
{
echo "pas de ssh2_fetch_stream";
}
}
else
{
echo "ssh2_exec echec<br>";
}
}
else
{
echo "Authentication Failed...<br>";
}
?>
[/php]
ça me retourne :
[code]Connection etablie !
ssh2_exec oki !
ssh2_fetch_stream[/code]