Class Net::SSH::Transport::Session
In: lib/net/ssh/transport/session.rb
Parent: Object

Represents a low-level SSH session, at the transport protocol level. This handles the algorithm negotiation and key exchange for any SSH connection.

Methods

Included Modules

Constants

Constants

NAME = "Ruby/Net::SSH"   The name that Net::SSH reports for itself
PROTOCOL = "SSH-2.0"   The SSH protocol supported by Net::SSH.
VALID_OPTIONS = [ :port, :host_key, :kex, :encryption, :hmac, :compression, :languages, :compression_level, :proxy, :timeout ]

Attributes

algorithm_negotiator  [W] 
algorithms  [R]  the collection of algorithms currently being used
ciphers  [W] 
compressors  [W] 
decompressors  [W] 
default_port  [W] 
hmacs  [W] 
kexs  [W] 
logger  [W] 
packet_receiver  [W] 
packet_sender  [W] 
session_id  [R]  the unique session identifier
socket_factory  [W] 
version_negotiator  [W] 

Public Class methods

Create a new connection to the given host. This will negotiate the algorithms to use and exchange the keys. A block must be given. The uninitialized self will be passed to the block, so that dependencies may be injected.

Returns the version string of this client.

Public Instance methods

Returns the name of the client’s host, as reported by the socket.

Closes the connection.

Sends an IGNORE packet to the server, as a way to ping the connection and make sure the server knows the client is still active.

Returns true if there are bytes to be read on the socket. Note that this only means there is an encrypted packet ready to be read, not that there is data available to any particular SSH channel.

Sends the given payload, using the currently configured OutgoingPacketStream.

Waits for the next message from the server, handling common requests like DISCONNECT, IGNORE, DEBUG, and KEXINIT in the background. The next message is returned as a [ type, buffer ] tuple, where the buffer is a Net::SSH::Util::ReaderBuffer.

[Validate]