code: def connectSubsystem(connection, protocol, subsystem):
      
      deferred = connectSession(connection, protocol)
      @deferred.addCallback
      def requestSubsystem(session):
          return session.requestSubsystem(subsystem)
      return deferred
docs: Connect a Protocol to a ssh subsystem channel