Jump to content
PielesiOs

NET/ssh2 nu merge pentru mai multe conexiuni

Recommended Posts

Posted (edited)


foreach($roots as $root)
{
$root=explode(";",$root);

$ssh = new Net_SSH2($root[0], 22, 3);
if ($ssh->login($root[1], $root[2]))
echo $root[0] . ";" . $root[1] .";" . $root[2] . "</br>" ;
$i++;
}

Am codul de mai sus, care din pacate moare dupa fiecare conexiune nereusita. De exemplu, daca ipul 84.12.31.213 nu raspunde la primul ping imi ajunge in die() si nu inteleg de ce, din moment ce eu nu am ramura pentru !$ssh in if si am setat si timeout la 3 secunde.

Pareri?

Folosesc net/ssh2 din phpseclib.

Edited by PielesiOs

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...