private function exec($command)
    {
        if (null === $this->_ssh_resource) {
            throw new TransportException(sprintf('None SSH connection available.'));
        }

        if (false === $stream = ssh2_exec($this->_ssh_resource, $command)) {
            throw new TransportException(sprintf('SSH command `%s` failed.', $command));
        }

        stream_set_blocking($stream, true);
        $data = "";
        while ($buf = fread($stream, 4096)) {
            $data .= $buf;
        }
        fclose($stream);

        return $data;
    }