class twisted.conch.ssh.session.SSHSession(channel.SSHChannel): (source)
A generalized implementation of an SSH session.
See RFC 4254, section 6.
The precise implementation of the various operations that the remote end can send is left up to the avatar, usually via an adapter to an interface such as ISession
.
Instance Variable | buf | a buffer for data received before making a connection to a client. |
Instance Variable | client | a protocol for communication with a shell, an application program, or a subsystem (see RFC 4254, section 6.5). |
Instance Variable | session | an object providing concrete implementations of session operations. |
Class Variable | name | Undocumented |
Method | __init__ | Undocumented |
Method | request_subsystem | Undocumented |
Method | request_shell | Undocumented |
Method | request_exec | Undocumented |
Method | request_pty_req | Undocumented |
Method | request_env | Process a request to pass an environment variable. |
Method | request_window_change | Undocumented |
Method | dataReceived | Called when we receive data. |
Method | extReceived | Called when we receive extended data (usually standard error). |
Method | eofReceived | Called when the other side will send no more data. |
Method | closed | Called when the channel is closed. This means that both our side and the remote side have closed the channel. |
Method | loseConnection | Close the channel if there is no buferred data. Otherwise, note the request and return. |
Inherited from SSHChannel:
Instance Variable | localWindowSize | the maximum size of the local window in bytes. |
Instance Variable | localWindowLeft | how many bytes are left in the local window. |
Instance Variable | localMaxPacket | the maximum size of packet we will accept in bytes. |
Instance Variable | remoteWindowLeft | how many bytes are left in the remote window. |
Instance Variable | remoteMaxPacket | the maximum size of a packet the remote side will accept in bytes. |
Instance Variable | conn | the connection this channel is multiplexed through. |
Instance Variable | data | any data to send to the other side when the channel is requested. |
Instance Variable | avatar | an avatar for the logged-in user (if a server channel) |
Instance Variable | localClosed | True if we aren't accepting more data. |
Instance Variable | remoteClosed | True if the other side isn't accepting more data. |
Instance Variable | areWriting | Undocumented |
Instance Variable | specificData | Undocumented |
Instance Variable | extBuf | Undocumented |
Instance Variable | closing | Undocumented |
Instance Variable | id | Undocumented |
Method | __str__ | Undocumented |
Method | __bytes__ | Return a byte string representation of the channel |
Method | logPrefix | Override this method to insert custom logging behavior. Its return value will be inserted in front of every line. It may be called more times than the number of output lines. |
Method | channelOpen | Called when the channel is opened. specificData is any data that the other side sent us when opening the channel. |
Method | openFailed | Called when the open failed for some reason. reason.desc is a string descrption, reason.code the SSH error code. |
Method | addWindowBytes | Called when bytes are added to the remote window. By default it clears the data buffers. |
Method | requestReceived | No summary |
Method | closeReceived | Called when the other side has closed the channel. |
Method | write | Write some data to the channel. If there is not enough remote window available, buffer until it is. Otherwise, split the data into packets of length remoteMaxPacket and send them. |
Method | writeExtended | Send extended data to this channel. If there is not enough remote window available, buffer until there is. Otherwise, split the data into packets of length remoteMaxPacket and send them. |
Method | writeSequence | Part of the Transport interface. Write a list of strings to the channel. |
Method | getPeer | See: ITransport.getPeer |
Method | getHost | See: ITransport.getHost |
Method | stopWriting | Called when the remote buffer is full, as a hint to stop writing. This can be ignored, but it can be helpful. |
Method | startWriting | Called when the remote buffer has more room, as a hint to continue writing. |
Class Variable | _log | Undocumented |
bytes
)
SSHSessionProcessProtocol
)
ISession
)
Process a request to pass an environment variable.
Parameters | data | The environment variable name and value, each encoded as an SSH protocol string and concatenated. (type: bytes ) |
Returns | A true value if the request to pass this environment variable was accepted, otherwise a false value. |
Called when we receive data.
Parameters | data | Undocumented (type: bytes ) |
Called when the channel is closed. This means that both our side and the remote side have closed the channel.
Close the channel if there is no buferred data. Otherwise, note the request and return.