@open_only<EOL><INDENT>def invoke_subsystem(self, subsystem):<DEDENT>
m = Message()<EOL>m.add_byte(cMSG_CHANNEL_REQUEST)<EOL>m.add_int(self.remote_chanid)<EOL>m.add_string("<STR_LIT>")<EOL>m.add_boolean(True)<EOL>m.add_string(subsystem)<EOL>self._event_pending()<EOL>self.transport._send_user_message(m)<EOL>self._wait_for_event()<EOL>
Request a subsystem on the server (for example, ``sftp``).  If the
server allows it, the channel will then be directly connected to the
requested subsystem.

When the subsystem finishes, the channel will be closed and can't be
reused.

:param str subsystem: name of the subsystem being requested.

:raises:
    `.SSHException` -- if the request was rejected or the channel was
    closed