Go to the latest version of this document.

# ``twisted`.`conch`.`scripts`.`conch`.`SSHConnection``

class documentation

`class SSHConnection(connection.SSHConnection): (source)`

View In Hierarchy

Undocumented

Method | `cancelRemoteForwarding` | Undocumented
Method | `channel_forwarded_tcpip` | Undocumented
Method | `channelClosed` | Called when a channel is closed. It clears the local state related to the channel, and calls channel.closed(). MAKE SURE YOU CALL THIS METHOD, even if you subclass `SSHConnection`. If you don't, things will break mysteriously.
Method | `requestRemoteForwarding` | Undocumented
Method | `serviceStarted` | called when the service is active on the transport.
Method | `serviceStopped` | Called when the connection is stopped.
Instance Variable | `localForwards` | Undocumented
Instance Variable | `remoteForwards` | Undocumented
Method | `_cbRemoteForwarding` | Undocumented
Method | `_ebRemoteForwarding` | Undocumented

Inherited from `SSHConnection`:

Method | `__init__` | Undocumented
Method | `adjustWindow` | Tell the other side that we will receive more data. This should not normally need to be called as it is managed automatically.
Method | `getChannel` | The other side requested a channel of some sort. channelType is the type of channel being requested, windowSize is the initial size of the remote window, maxPacket is the largest packet we should send, data is any other packet data (often nothing).
Method | `gotGlobalRequest` | We got a global request. pretty much, this is just used by the client to request that we forward a port from the server to the client. Returns either:
Method | `openChannel` | Open a new channel on this connection.
Method | `sendClose` | Close a channel.
Method | `sendData` | Send data to a channel. This should not normally be used: instead use channel.write(data) as it manages the window automatically.
Method | `sendEOF` | Send an EOF (End of File) for a channel.
Method | `sendExtendedData` | Send extended data to a channel. This should not normally be used: instead use channel.writeExtendedData(data, dataType) as it manages the window automatically.
Method | `sendGlobalRequest` | Send a global request for this connection. Current this is only used for remote->local TCP forwarding.
Method | `sendRequest` | Send a request to a channel.
Method | `ssh_CHANNEL_CLOSE` | The other side is closing its end; it does not want to receive any more data. Payload:
Method | `ssh_CHANNEL_DATA` | The other side is sending us data. Payload:
Method | `ssh_CHANNEL_EOF` | The other side is not sending any more data. Payload:
Method | `ssh_CHANNEL_EXTENDED_DATA` | The other side is sending us exteneded data. Payload:
Method | `ssh_CHANNEL_FAILURE` | Our channel request to the other side failed. Payload:
Method | `ssh_CHANNEL_OPEN` | The other side wants to get a channel. Payload:
Method | `ssh_CHANNEL_OPEN_CONFIRMATION` | The other side accepted our MSG_CHANNEL_OPEN request. Payload:
Method | `ssh_CHANNEL_OPEN_FAILURE` | The other side did not accept our MSG_CHANNEL_OPEN request. Payload:
Method | `ssh_CHANNEL_REQUEST` | The other side is sending a request to a channel. Payload:
Method | `ssh_CHANNEL_SUCCESS` | Our channel request to the other side succeeded. Payload:
Method | `ssh_CHANNEL_WINDOW_ADJUST` | The other side is adding bytes to its window. Payload:
Method | `ssh_GLOBAL_REQUEST` | The other side has made a global request. Payload:
Method | `ssh_REQUEST_FAILURE` | Our global request failed. Get the appropriate Deferred and errback it with the packet we received.
Method | `ssh_REQUEST_SUCCESS` | Our global request succeeded. Get the appropriate Deferred and call it back with the packet we received.
Class Variable | `name` | Undocumented
Instance Variable | `channels` | a `dict` mapping a local channel ID to `SSHChannel` subclasses.
Instance Variable | `channelsToRemoteChannel` | a `dict` mapping a `SSHChannel` subclass to remote channel ID.
Instance Variable | `deferreds` | a `dict` mapping a local channel ID to a `list` of `Deferreds` for outstanding channel requests. Also, the 'global' key stores the `list` of pending global request `Deferred`s.
Instance Variable | `localChannelID` | the next number to use as a local channel ID.
Instance Variable | `localToRemoteChannel` | a `dict` mapping a local channel ID to a remote channel ID.
Instance Variable | `transport` | Undocumented
Method | `_cbChannelRequest` | Called back if the other side wanted a reply to a channel request. If the result is true, send a MSG_CHANNEL_SUCCESS. Otherwise, raise a `error.ConchError`
Method | `_cleanupGlobalDeferreds` | All pending requests that have returned a deferred must be errbacked when this service is stopped, otherwise they might be left uncalled and uncallable.
Method | `_ebChannelRequest` | Called if the other wisde wanted a reply to the channel requeset and the channel request failed.
Class Variable | `_log` | Undocumented

Inherited from `SSHService` (via `SSHConnection`):

Method | `logPrefix` | Undocumented
Method | `packetReceived` | called when we receive a packet on the transport
Class Variable | `protocolMessages` | Undocumented

def cancelRemoteForwarding(self, remotePort): (source)

Undocumented

def channel_forwarded_tcpip(self, windowSize, maxPacket, data): (source)

Undocumented

def channelClosed(self, channel): (source)
overrides `twisted.conch.ssh.connection.SSHConnection.channelClosed`

Called when a channel is closed. It clears the local state related to the channel, and calls channel.closed(). MAKE SURE YOU CALL THIS METHOD, even if you subclass `SSHConnection`. If you don't, things will break mysteriously.

Parameters
channel:`SSHChannel` | Undocumented

def requestRemoteForwarding(self, remotePort, hostport): (source)

Undocumented

def serviceStarted(self): (source)
overrides `twisted.conch.ssh.connection.SSHConnection.serviceStarted`

called when the service is active on the transport.

def serviceStopped(self): (source)
overrides `twisted.conch.ssh.connection.SSHConnection.serviceStopped`

Called when the connection is stopped.

localForwards: `list` = (source)

Undocumented

remoteForwards: `dict` = (source)

Undocumented

def _cbRemoteForwarding(self, result, remotePort, hostport): (source)

Undocumented

def _ebRemoteForwarding(self, f, remotePort, hostport): (source)

Undocumented