/**
* Logs in to a SSH server with the specified credentials,
* and returns the Net_SSH2 instance.
*
* @return Net_SSH2 $ssh
* @author Ronald Rey
**/
public static final function getSSH($host, $user, $pass, $timeout)
{
$ssh = new Net_SSH2($host);
if (!$ssh->login($user, $pass)) {
exit('Login to failed.');
}
$ssh->setTimeout($timeout);
$ssh->write(" ");
return $ssh;
}