Isn't the JSch session protected access and thus not visible unless you subclass TransportSsh?

I'm not sure how passing the transport in the constructor is helping you here.

Maybe we just need to wrap the session into a RemoteSession type, put that into TransportSsh, and have the RemoteSession be the RemoteCommandConnection factory?

For the TransportSftp case, we'll just have to require that the RemoteSession be an instanceof JSchRemoteSession so it can downcast and pull out the JSch session handle.