if (authenticationState != AuthenticationProtocolState.COMPLETE) {
throw new SshException("Authentication has not been completed!");
}
SessionChannelClient session = new SessionChannelClient();
session.addEventListener(activeChannelListener);
if (!connection.openChannel(session, eventListener)) {
throw new SshException("The server refused to open a session");
}