channel.setOut(out);
ByteArrayOutputStream err = new ByteArrayOutputStream();
channel.setErr(err);
OpenFuture openFuture = channel.open();
openFuture.await(getTimeout());
if (openFuture.isOpened()) {
channel.waitFor(ClientChannel.CLOSED, 0);
result = new SshResult(command, channel.getExitStatus(),
new ByteArrayInputStream(out.toByteArray()),
new ByteArrayInputStream(err.toByteArray()));