class documentation

class SSHSession(channel.SSHChannel): (source)

View In Hierarchy

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.

Method __init__ Undocumented
Method closed Called when the channel is closed. This means that both our side and the remote side have closed the channel.
Method data​Received Called when we receive data.
Method eof​Received Called when the other side will send no more data.
Method ext​Received Called when we receive extended data (usually standard error).
Method lose​Connection Close the channel if there is no buferred data. Otherwise, note the request and return.
Method request​_env Process a request to pass an environment variable.
Method request​_exec Undocumented
Method request​_pty​_req Undocumented
Method request​_shell Undocumented
Method request​_subsystem Undocumented
Method request​_window​_change Undocumented
Class Variable name Undocumented
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.

Inherited from SSHChannel:

Method __bytes__ Return a byte string representation of the channel
Method __str__ Undocumented
Method add​Window​Bytes Called when bytes are added to the remote window. By default it clears the data buffers.
Method channel​Open Called when the channel is opened. specificData is any data that the other side sent us when opening the channel.
Method close​Received Called when the other side has closed the channel.
Method get​Host See: ITransport.getHost
Method get​Peer See: ITransport.getPeer
Method log​Prefix 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 open​Failed Called when the open failed for some reason. reason.desc is a string descrption, reason.code the SSH error code.
Method request​Received No summary
Method start​Writing Called when the remote buffer has more room, as a hint to continue writing.
Method stop​Writing Called when the remote buffer is full, as a hint to stop writing. This can be ignored, but it can be helpful.
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 write​Extended 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 write​Sequence Part of the Transport interface. Write a list of strings to the channel.
Instance Variable are​Writing Undocumented
Instance Variable avatar an avatar for the logged-in user (if a server channel)
Instance Variable closing Undocumented
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 ext​Buf Undocumented
Instance Variable id Undocumented
Instance Variable local​Closed True if we aren't accepting more data.
Instance Variable local​Max​Packet the maximum size of packet we will accept in bytes.
Instance Variable local​Window​Left how many bytes are left in the local window.
Instance Variable local​Window​Size the maximum size of the local window in bytes.
Instance Variable remote​Closed True if the other side isn't accepting more data.
Instance Variable remote​Max​Packet the maximum size of a packet the remote side will accept in bytes.
Instance Variable remote​Window​Left how many bytes are left in the remote window.
Instance Variable specific​Data Undocumented
Class Variable _log Undocumented
def __init__(self, *args, **kw): (source)
def closed(self): (source)
Called when the channel is closed. This means that both our side and the remote side have closed the channel.
def dataReceived(self, data): (source)
Called when we receive data.
Parameters
data:bytesUndocumented
def eofReceived(self): (source)
Called when the other side will send no more data.
def extReceived(self, dataType, data): (source)
Called when we receive extended data (usually standard error).
Parameters
data​Type:intUndocumented
data:strUndocumented
def loseConnection(self): (source)
Close the channel if there is no buferred data. Otherwise, note the request and return.
def request_env(self, data): (source)
Process a request to pass an environment variable.
Parameters
data:bytesThe environment variable name and value, each encoded as an SSH protocol string and concatenated.
Returns
A true value if the request to pass this environment variable was accepted, otherwise a false value.
def request_exec(self, data): (source)

Undocumented

def request_pty_req(self, data): (source)

Undocumented

def request_shell(self, data): (source)

Undocumented

def request_subsystem(self, data): (source)

Undocumented

def request_window_change(self, data): (source)

Undocumented

a buffer for data received before making a connection to a client.
a protocol for communication with a shell, an application program, or a subsystem (see RFC 4254, section 6.5).
session: ISession = (source)
an object providing concrete implementations of session operations.