PHP Class Net_SSH2, TeamPass

Author: Jim Wigginton ([email protected])
Show file Open project: nilsteampassnet/TeamPass Class Usage Examples

Public Properties

Property Type Description
$agent System_SSH_Agent A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario
$banner_message string Quoting from the RFC, "in some jurisdictions, sending a warning message before authentication may be relevant for getting legal protection."
$bitmap integer The bits that are set represent functions that have been called already. This is used to determine if a requisite function has been successfully executed. If not, an error should be thrown.
$channel_buffers array If a client requests a packet from one channel but receives two packets from another those packets should be placed in a buffer
$channel_extended_data_type_codes array SSH_MSG_CHANNEL_EXTENDED_DATA's data_type_codes
$channel_open_failure_reasons array SSH_MSG_CHANNEL_OPEN_FAILURE 'reason codes', defined in RFC4254
$channel_status array Contains the type of the last sent message
$compression_algorithms_client_to_server array | false Compression Algorithms: Client to Server
$compression_algorithms_server_to_client array | false Compression Algorithms: Server to Client
$crypto_engine integer Crypto Engine
$curTimeout Current Timeout
$decrypt object Server to Client Encryption Object
$decrypt_block_size integer Block Size for Client to Server Encryption
$disconnect_reasons array Disconnection Message 'reason codes' defined in RFC4253
$encrypt object Client to Server Encryption Object
$encrypt_block_size integer "Note that the length of the concatenation of 'packet_length', 'padding_length', 'payload', and 'random padding' MUST be a multiple of the cipher block size or 8, whichever is larger. This constraint MUST be enforced, even when using stream ciphers." -- http://tools.ietf.org/html/rfc4253#section-6
$encryption_algorithms_client_to_server array | false Encryption Algorithms: Client to Server
$encryption_algorithms_server_to_client array | false Encryption Algorithms: Server to Client
$errors string Error information
$exchange_hash string The current exchange hash
$exit_status integer Exit status returned from ssh if any
$fsock object The Socket Object
$get_seq_no integer See 'Section 6.4. Data Integrity' of rfc4253 for more info.
$hmac_check object Server to Client HMAC Object
$hmac_create object Client to Server HMAC Object
$hmac_size integer We need to know how big the HMAC will be for the server to client direction so that we know how many bytes to read. For the client to server side, the HMAC object will make the HMAC as long as it needs to be. All we need to do is append it.
$host string Hostname
$identifier string The SSH identifier
$in_request_pty_exec boolean Flag set while exec() is running when using enablePTY()
$in_subsystem boolean Flag set after startSubsystem() is called
$interactiveBuffer array Interactive Buffer
$is_timeout boolean Did read() timeout or return normally?
$kex_algorithms array | false Key Exchange Algorithms
$kex_dh_group_size_max integer Maximum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
$kex_dh_group_size_min integer Minimum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
$kex_dh_group_size_preferred integer Preferred Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
$keyboard_requests_responses array Keyboard Interactive Request / Responses
$languages_client_to_server array | false Languages: Client to Server
$languages_server_to_client array | false Languages: Server to Client
$last_interactive_response string The Last Interactive Response
$last_packet integer Time of first network activity
$log_boundary string Log Boundary
$log_long_width integer Log Long Width
$log_short_width integer Log Short Width
$log_size integer Should never exceed NET_SSH2_LOG_MAX_SIZE
$mac_algorithms_client_to_server array | false MAC Algorithms: Client to Server
$mac_algorithms_server_to_client array | false MAC Algorithms: Server to Client
$message_log array Message Log
$message_number_log array Message Number Log
$message_numbers array Message Numbers
$packet_size_client_to_server array Maximum packet size indexed by channel
$port integer Port Number
$quiet_mode Flag to suppress stderr from output
$realtime_log_file resource Real-time log file pointer
$realtime_log_size integer Real-time log file size
$realtime_log_wrap Real-time log file wrap boolean
$request_pty boolean Flag to request a PTY when using exec()
$send_seq_no integer See 'Section 6.4. Data Integrity' of rfc4253 for more info.
$server_channels array Maps client channels to server channels
$server_host_key_algorithms array | false Server Host Key Algorithms
$server_identifier array | false Server Identifier
$server_public_host_key string Server Public Host Key
$session_id string "The exchange hash H from the first key exchange is additionally used as the session identifier, which is a unique identifier for this connection." -- http://tools.ietf.org/html/rfc4253#section-7.2
$signature string Verified against $this->session_id
$signature_format string ssh-rsa or ssh-dss.
$signature_validated boolean Has the signature been validated?
$stdErrorLog string Contents of stdError
$terminal_modes array Terminal Modes
$timeout Timeout
$windowColumns integer Number of columns for terminal window size
$windowRows integer Number of columns for terminal window size
$window_size integer Bytes the other party can send before it must wait for the window to be adjusted (0x7FFFFFFF = 2GB)
$window_size_client_to_server array Window size indexed by channel
$window_size_server_to_client array Window size indexed by channel

Public Methods

Method Description
Net_SSH2 ( mixed $host, integer $port = 22, integer $timeout = 10 ) : Net_SSH2 Default Constructor.
__destruct ( ) Destructor.
_append_log ( $message_number, $message ) Logs data packets
_array_intersect_first ( array $array1, array $array2 ) : mixed Returns the first value of the intersection of two arrays or false if the intersection is empty. The order is defined by the first parameter.
_close_channel ( integer $client_channel, boolean $want_reply = false ) : boolean Closes and flushes a channel
_connect ( ) : boolean Connect to an SSHv2 server
_define_array ( ) Define Array
_disconnect ( integer $reason ) : boolean Disconnect
_encryption_algorithm_to_key_size ( string $algorithm ) : integer | null Maps an encryption algorithm name to the number of key bytes.
_filter ( $payload ) : string Filter Binary Packets
_format_log ( array $message_log, array $message_number_log ) : string Formats a log for printing
_format_log_helper ( array $matches ) : string Helper function for _format_log
_generate_identifier ( ) : string Generates the SSH identifier
_get_binary_packet ( ) : string Gets Binary Packets
_get_channel_packet ( $client_channel, $skip_extended = false ) : mixed Gets channel data
_get_interactive_channel ( ) : integer Return the channel to be used with read() / write()
_get_open_channel ( ) : integer Return an available open channel
_initShell ( ) : boolean Creates an interactive shell
_key_exchange ( string $kexinit_payload_server ) Key Exchange
_keyboard_interactive_login ( string $username, string $password ) : boolean Login via keyboard-interactive authentication
_keyboard_interactive_process ( ) : boolean Handle the keyboard-interactive requests / responses.
_login ( string $username ) : boolean Login Helper
_login_helper ( string $username, string $password = null ) : boolean Login Helper
_on_channel_open ( ) Helper function for agent->_on_channel_open()
_privatekey_login ( string $username, $privatekey ) : boolean Login with an RSA private key
_send_binary_packet ( string $data, string $logged = null ) : boolean Sends Binary Packets
_send_channel_packet ( integer $client_channel, string $data ) : boolean Sends channel data
_ssh_agent_login ( string $username, System_SSH_Agent $agent ) : boolean Login with an ssh-agent provided key
_string_shift ( string &$string, integer $index = 1 ) : string String Shift
disablePTY ( ) Disable request-pty when using exec()
disableQuietMode ( ) Disable Quiet Mode
disconnect ( ) Disconnect
enablePTY ( ) Enable request-pty when using exec()
enableQuietMode ( ) Enable Quiet Mode
exec ( string $command, Callback $callback = null ) : string Execute Command
getBannerMessage ( ) : string Returns the banner message.
getCompressionAlgorithmsClient2Server ( ) : array Return a list of the compression algorithms the server supports, when receiving stuff from the client.
getCompressionAlgorithmsServer2Client ( ) : array Return a list of the compression algorithms the server supports, when sending stuff to the client.
getEncryptionAlgorithmsClient2Server ( ) : array Return a list of the (symmetric key) encryption algorithms the server supports, when receiving stuff from the client.
getEncryptionAlgorithmsServer2Client ( ) : array Return a list of the (symmetric key) encryption algorithms the server supports, when sending stuff to the client.
getErrors ( ) : string Returns all errors
getExitStatus ( ) : false | integer Returns the exit status of an SSH command or false.
getKexAlgorithms ( ) : array Return a list of the key exchange algorithms the server supports.
getLanguagesClient2Server ( ) : array Return a list of the languages the server supports, when receiving stuff from the client.
getLanguagesServer2Client ( ) : array Return a list of the languages the server supports, when sending stuff to the client.
getLastError ( ) : string Returns the last error
getLog ( ) : array | false | string Returns a log of the packets that have been sent and received.
getMACAlgorithmsClient2Server ( ) : array Return a list of the MAC algorithms the server supports, when receiving stuff from the client.
getMACAlgorithmsServer2Client ( ) : array Return a list of the MAC algorithms the server supports, when sending stuff to the client.
getServerHostKeyAlgorithms ( ) : array Return a list of the host key (public key) algorithms the server supports.
getServerIdentification ( ) : string Return the server identification.
getServerPublicHostKey ( ) : mixed Returns the server public host key.
getStdError ( ) Get the output from stdError
getWindowColumns ( ) : integer Returns the number of columns for the terminal window size.
getWindowRows ( ) : integer Returns the number of rows for the terminal window size.
isAuthenticated ( ) : boolean Have you successfully been logged in?
isConnected ( ) : boolean Is the connection still active?
isPTYEnabled ( ) : boolean Returns whether request-pty is enabled or not
isQuietModeEnabled ( ) : boolean Returns whether Quiet Mode is enabled or not
isTimeout ( ) Is timeout?
login ( string $username ) : boolean Login
read ( string $expect = '', integer $mode = NET_SSH2_READ_SIMPLE ) : string Returns the output of an interactive shell
reset ( ) Closes a channel
setCryptoEngine ( integer $engine ) Set Crypto Engine Mode
setTimeout ( mixed $timeout ) Set Timeout
setWindowColumns ( integer $value ) Sets the number of columns for the terminal window size.
setWindowRows ( integer $value ) Sets the number of rows for the terminal window size.
setWindowSize ( integer $columns = 80, integer $rows = 24 ) Sets the number of columns and rows for the terminal window size.
startSubsystem ( string $subsystem ) : boolean Start a subsystem.
stopSubsystem ( ) : boolean Stops a subsystem.
write ( string $cmd ) : boolean Inputs a command into an interactive shell.

Method Details

Net_SSH2() public method

$host can either be a string, representing the host, or a stream resource.
See also: self::login()
public Net_SSH2 ( mixed $host, integer $port = 22, integer $timeout = 10 ) : Net_SSH2
$host mixed
$port integer
$timeout integer
return Net_SSH2

__destruct() public method

Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call disconnect().
public __destruct ( )

_append_log() public method

Makes sure that only the last 1MB worth of packets will be logged
public _append_log ( $message_number, $message )

_array_intersect_first() public method

Returns the first value of the intersection of two arrays or false if the intersection is empty. The order is defined by the first parameter.
public _array_intersect_first ( array $array1, array $array2 ) : mixed
$array1 array
$array2 array
return mixed False if intersection is empty, else intersected value.

_close_channel() public method

Net_SSH2 doesn't properly close most channels. For exec() channels are normally closed by the server and for SFTP channels are presumably closed when the client disconnects. This functions is intended for SCP more than anything.
public _close_channel ( integer $client_channel, boolean $want_reply = false ) : boolean
$client_channel integer
$want_reply boolean
return boolean

_connect() public method

Connect to an SSHv2 server
public _connect ( ) : boolean
return boolean

_define_array() public method

Takes any number of arrays whose indices are integers and whose values are strings and defines a bunch of named constants from it, using the value as the name of the constant and the index as the value of the constant. If any of the constants that would be defined already exists, none of the constants will be defined.
public _define_array ( )

_disconnect() public method

Disconnect
public _disconnect ( integer $reason ) : boolean
$reason integer
return boolean

_encryption_algorithm_to_key_size() public method

Maps an encryption algorithm name to the number of key bytes.
public _encryption_algorithm_to_key_size ( string $algorithm ) : integer | null
$algorithm string Name of the encryption algorithm
return integer | null Number of bytes as an integer or null for unknown

_filter() public method

Because some binary packets need to be ignored...
See also: self::_get_binary_packet()
public _filter ( $payload ) : string
return string

_format_log() public method

Formats a log for printing
public _format_log ( array $message_log, array $message_number_log ) : string
$message_log array
$message_number_log array
return string

_format_log_helper() public method

For use with preg_replace_callback()
public _format_log_helper ( array $matches ) : string
$matches array
return string

_generate_identifier() public method

You should overwrite this method in your own class if you want to use another identifier
public _generate_identifier ( ) : string
return string

_get_binary_packet() public method

See '6. Binary Packet Protocol' of rfc4253 for more info.
See also: self::_send_binary_packet()
public _get_binary_packet ( ) : string
return string

_get_channel_packet() public method

Returns the data as a string if it's available and false if not.
public _get_channel_packet ( $client_channel, $skip_extended = false ) : mixed
$client_channel
return mixed

_get_interactive_channel() public method

Return the channel to be used with read() / write()
See also: self::read()
See also: self::write()

_get_open_channel() public method

Return an available open channel
public _get_open_channel ( ) : integer
return integer

_initShell() public method

Creates an interactive shell
See also: self::read()
See also: self::write()
public _initShell ( ) : boolean
return boolean

_key_exchange() public method

Key Exchange
public _key_exchange ( string $kexinit_payload_server )
$kexinit_payload_server string

_keyboard_interactive_login() public method

See {@link http://tools.ietf.org/html/rfc4256 RFC4256} for details. This is not a full-featured keyboard-interactive authenticator.
public _keyboard_interactive_login ( string $username, string $password ) : boolean
$username string
$password string
return boolean

_keyboard_interactive_process() public method

Handle the keyboard-interactive requests / responses.

_login() public method

Login Helper
See also: self::_login_helper()
public _login ( string $username ) : boolean
$username string
return boolean

_login_helper() public method

Login Helper
public _login_helper ( string $username, string $password = null ) : boolean
$username string
$password string
return boolean

_on_channel_open() public method

Used when channels are created to inform agent of said channel opening. Must be called after channel open confirmation received
public _on_channel_open ( )

_privatekey_login() public method

Login with an RSA private key
public _privatekey_login ( string $username, $privatekey ) : boolean
$username string
return boolean

_send_binary_packet() public method

See '6. Binary Packet Protocol' of rfc4253 for more info.
See also: self::_get_binary_packet()
public _send_binary_packet ( string $data, string $logged = null ) : boolean
$data string
$logged string
return boolean

_send_channel_packet() public method

Spans multiple SSH_MSG_CHANNEL_DATAs if appropriate
public _send_channel_packet ( integer $client_channel, string $data ) : boolean
$client_channel integer
$data string
return boolean

_ssh_agent_login() public method

Login with an ssh-agent provided key
public _ssh_agent_login ( string $username, System_SSH_Agent $agent ) : boolean
$username string
$agent System_SSH_Agent
return boolean

_string_shift() public method

Inspired by array_shift
public _string_shift ( string &$string, integer $index = 1 ) : string
$string string
$index integer
return string

disablePTY() public method

Disable request-pty when using exec()
public disablePTY ( )

disableQuietMode() public method

Show stderr in output
public disableQuietMode ( )

disconnect() public method

Disconnect
public disconnect ( )

enablePTY() public method

Enable request-pty when using exec()
public enablePTY ( )

enableQuietMode() public method

Suppress stderr from output
public enableQuietMode ( )

exec() public method

If $callback is set to false then Net_SSH2::_get_channel_packet(NET_SSH2_CHANNEL_EXEC) will need to be called manually. In all likelihood, this is not a feature you want to be taking advantage of.
public exec ( string $command, Callback $callback = null ) : string
$command string
$callback Callback
return string

getBannerMessage() public method

Quoting from the RFC, "in some jurisdictions, sending a warning message before authentication may be relevant for getting legal protection."
public getBannerMessage ( ) : string
return string

getCompressionAlgorithmsClient2Server() public method

Return a list of the compression algorithms the server supports, when receiving stuff from the client.

getCompressionAlgorithmsServer2Client() public method

Return a list of the compression algorithms the server supports, when sending stuff to the client.

getEncryptionAlgorithmsClient2Server() public method

Return a list of the (symmetric key) encryption algorithms the server supports, when receiving stuff from the client.

getEncryptionAlgorithmsServer2Client() public method

Return a list of the (symmetric key) encryption algorithms the server supports, when sending stuff to the client.

getErrors() public method

Returns all errors
public getErrors ( ) : string
return string

getExitStatus() public method

Returns the exit status of an SSH command or false.
public getExitStatus ( ) : false | integer
return false | integer

getKexAlgorithms() public method

Return a list of the key exchange algorithms the server supports.
public getKexAlgorithms ( ) : array
return array

getLanguagesClient2Server() public method

Return a list of the languages the server supports, when receiving stuff from the client.
public getLanguagesClient2Server ( ) : array
return array

getLanguagesServer2Client() public method

Return a list of the languages the server supports, when sending stuff to the client.
public getLanguagesServer2Client ( ) : array
return array

getLastError() public method

Returns the last error
public getLastError ( ) : string
return string

getLog() public method

Returns a string if NET_SSH2_LOGGING == NET_SSH2_LOG_COMPLEX, an array if NET_SSH2_LOGGING == NET_SSH2_LOG_SIMPLE and false if !defined('NET_SSH2_LOGGING')
public getLog ( ) : array | false | string
return array | false | string

getMACAlgorithmsClient2Server() public method

Return a list of the MAC algorithms the server supports, when receiving stuff from the client.

getMACAlgorithmsServer2Client() public method

Return a list of the MAC algorithms the server supports, when sending stuff to the client.

getServerHostKeyAlgorithms() public method

Return a list of the host key (public key) algorithms the server supports.
public getServerHostKeyAlgorithms ( ) : array
return array

getServerIdentification() public method

Return the server identification.
public getServerIdentification ( ) : string
return string

getServerPublicHostKey() public method

Caching this the first time you connect to a server and checking the result on subsequent connections is recommended. Returns false if the server signature is not signed correctly with the public host key.
public getServerPublicHostKey ( ) : mixed
return mixed

getStdError() public method

Get the output from stdError
public getStdError ( )

getWindowColumns() public method

Returns the number of columns for the terminal window size.
public getWindowColumns ( ) : integer
return integer

getWindowRows() public method

Returns the number of rows for the terminal window size.
public getWindowRows ( ) : integer
return integer

isAuthenticated() public method

Have you successfully been logged in?
public isAuthenticated ( ) : boolean
return boolean

isConnected() public method

Is the connection still active?
public isConnected ( ) : boolean
return boolean

isPTYEnabled() public method

Returns whether request-pty is enabled or not
See also: self::enablePTY()
See also: self::disablePTY()
public isPTYEnabled ( ) : boolean
return boolean

isQuietModeEnabled() public method

Returns whether Quiet Mode is enabled or not
See also: self::enableQuietMode()
See also: self::disableQuietMode()
public isQuietModeEnabled ( ) : boolean
return boolean

isTimeout() public method

Did exec() or read() return because they timed out or because they encountered the end?
public isTimeout ( )

login() public method

The $password parameter can be a plaintext password, a Crypt_RSA object or an array
See also: self::_login()
public login ( string $username ) : boolean
$username string
return boolean

read() public method

Returns when there's a match for $expect, which can take the form of a string literal or, if $mode == NET_SSH2_READ_REGEX, a regular expression.
See also: self::write()
public read ( string $expect = '', integer $mode = NET_SSH2_READ_SIMPLE ) : string
$expect string
$mode integer
return string

reset() public method

If read() timed out you might want to just close the channel and have it auto-restart on the next read() call
public reset ( )

setCryptoEngine() public method

Possible $engine values: CRYPT_MODE_INTERNAL, CRYPT_MODE_MCRYPT
public setCryptoEngine ( integer $engine )
$engine integer

setTimeout() public method

$ssh->exec('ping 127.0.0.1'); on a Linux host will never return and will run indefinitely. setTimeout() makes it so it'll timeout. Setting $timeout to false or 0 will mean there is no timeout.
public setTimeout ( mixed $timeout )
$timeout mixed

setWindowColumns() public method

Sets the number of columns for the terminal window size.
public setWindowColumns ( integer $value )
$value integer

setWindowRows() public method

Sets the number of rows for the terminal window size.
public setWindowRows ( integer $value )
$value integer

setWindowSize() public method

Sets the number of columns and rows for the terminal window size.
public setWindowSize ( integer $columns = 80, integer $rows = 24 )
$columns integer
$rows integer

startSubsystem() public method

Right now only one subsystem at a time is supported. To support multiple subsystem's stopSubsystem() could accept a string that contained the name of the subsystem, but at that point, only one subsystem of each type could be opened. To support multiple subsystem's of the same name maybe it'd be best if startSubsystem() generated a new channel id and returns that and then that that was passed into stopSubsystem() but that'll be saved for a future date and implemented if there's sufficient demand for such a feature.
See also: self::stopSubsystem()
public startSubsystem ( string $subsystem ) : boolean
$subsystem string
return boolean

stopSubsystem() public method

Stops a subsystem.
See also: self::startSubsystem()
public stopSubsystem ( ) : boolean
return boolean

write() public method

Inputs a command into an interactive shell.
See also: self::read()
public write ( string $cmd ) : boolean
$cmd string
return boolean

Property Details

$agent public property

A System_SSH_Agent for use in the SSH2 Agent Forwarding scenario
public System_SSH_Agent $agent
return System_SSH_Agent

$banner_message public property

Quoting from the RFC, "in some jurisdictions, sending a warning message before authentication may be relevant for getting legal protection."
See also: self::_filter()
See also: self::getBannerMessage()
public string $banner_message
return string

$bitmap public property

The bits that are set represent functions that have been called already. This is used to determine if a requisite function has been successfully executed. If not, an error should be thrown.
public int $bitmap
return integer

$channel_buffers public property

If a client requests a packet from one channel but receives two packets from another those packets should be placed in a buffer
See also: self::_get_channel_packet()
See also: self::exec()
public array $channel_buffers
return array

$channel_extended_data_type_codes public property

SSH_MSG_CHANNEL_EXTENDED_DATA's data_type_codes
See also: self::Net_SSH2()
public array $channel_extended_data_type_codes
return array

$channel_open_failure_reasons public property

SSH_MSG_CHANNEL_OPEN_FAILURE 'reason codes', defined in RFC4254
See also: self::Net_SSH2()
public array $channel_open_failure_reasons
return array

$channel_status public property

Contains the type of the last sent message
See also: self::_get_channel_packet()
public array $channel_status
return array

$compression_algorithms_client_to_server public property

Compression Algorithms: Client to Server
See also: self::getCompressionAlgorithmsClient2Server()
public array|false $compression_algorithms_client_to_server
return array | false

$compression_algorithms_server_to_client public property

Compression Algorithms: Server to Client
See also: self::getCompressionAlgorithmsServer2Client()
public array|false $compression_algorithms_server_to_client
return array | false

$crypto_engine public property

Crypto Engine
See also: self::setCryptoEngine()
See also: self::_key_exchange()
public int $crypto_engine
return integer

$curTimeout public property

Current Timeout
See also: self::_get_channel_packet()
public $curTimeout

$decrypt public property

Server to Client Encryption Object
See also: self::_get_binary_packet()
public object $decrypt
return object

$decrypt_block_size public property

Block Size for Client to Server Encryption
See also: self::Net_SSH2()
See also: self::_get_binary_packet()
public int $decrypt_block_size
return integer

$disconnect_reasons public property

Disconnection Message 'reason codes' defined in RFC4253
See also: self::Net_SSH2()
public array $disconnect_reasons
return array

$encrypt public property

Client to Server Encryption Object
See also: self::_send_binary_packet()
public object $encrypt
return object

$encrypt_block_size public property

"Note that the length of the concatenation of 'packet_length', 'padding_length', 'payload', and 'random padding' MUST be a multiple of the cipher block size or 8, whichever is larger. This constraint MUST be enforced, even when using stream ciphers." -- http://tools.ietf.org/html/rfc4253#section-6
See also: self::Net_SSH2()
See also: self::_send_binary_packet()
public int $encrypt_block_size
return integer

$encryption_algorithms_client_to_server public property

Encryption Algorithms: Client to Server
See also: self::getEncryptionAlgorithmsClient2Server()
public array|false $encryption_algorithms_client_to_server
return array | false

$encryption_algorithms_server_to_client public property

Encryption Algorithms: Server to Client
See also: self::getEncryptionAlgorithmsServer2Client()
public array|false $encryption_algorithms_server_to_client
return array | false

$errors public property

Error information
See also: self::getErrors()
See also: self::getLastError()
public string $errors
return string

$exchange_hash public property

The current exchange hash
See also: self::_key_exchange()
public string $exchange_hash
return string

$exit_status public property

Exit status returned from ssh if any
public int $exit_status
return integer

$fsock public property

The Socket Object
public object $fsock
return object

$get_seq_no public property

See 'Section 6.4. Data Integrity' of rfc4253 for more info.
See also: self::_get_binary_packet()
public int $get_seq_no
return integer

$hmac_check public property

Server to Client HMAC Object
See also: self::_get_binary_packet()
public object $hmac_check
return object

$hmac_create public property

Client to Server HMAC Object
See also: self::_send_binary_packet()
public object $hmac_create
return object

$hmac_size public property

We need to know how big the HMAC will be for the server to client direction so that we know how many bytes to read. For the client to server side, the HMAC object will make the HMAC as long as it needs to be. All we need to do is append it.
See also: self::_get_binary_packet()
public int $hmac_size
return integer

$host public property

Hostname
See also: self::Net_SSH2()
See also: self::_connect()
public string $host
return string

$identifier public property

The SSH identifier
public string $identifier
return string

$in_request_pty_exec public property

Flag set while exec() is running when using enablePTY()
public bool $in_request_pty_exec
return boolean

$in_subsystem public property

Flag set after startSubsystem() is called
public bool $in_subsystem
return boolean

$interactiveBuffer public property

Interactive Buffer
See also: self::read()
public array $interactiveBuffer
return array

$is_timeout public property

Did read() timeout or return normally?
See also: self::isTimeout()
public bool $is_timeout
return boolean

$kex_algorithms public property

Key Exchange Algorithms
See also: self::getKexAlgorithims()
public array|false $kex_algorithms
return array | false

$kex_dh_group_size_max public property

Maximum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
See also: self::_key_exchange()
public int $kex_dh_group_size_max
return integer

$kex_dh_group_size_min public property

Minimum Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
See also: self::_key_exchange()
public int $kex_dh_group_size_min
return integer

$kex_dh_group_size_preferred public property

Preferred Diffie-Hellman Group Bit Size in RFC 4419 Key Exchange Methods
See also: self::_key_exchange()
public int $kex_dh_group_size_preferred
return integer

$keyboard_requests_responses public property

Keyboard Interactive Request / Responses
See also: self::_keyboard_interactive_process()
public array $keyboard_requests_responses
return array

$languages_client_to_server public property

Languages: Client to Server
See also: self::getLanguagesClient2Server()
public array|false $languages_client_to_server
return array | false

$languages_server_to_client public property

Languages: Server to Client
See also: self::getLanguagesServer2Client()
public array|false $languages_server_to_client
return array | false

$last_interactive_response public property

The Last Interactive Response
See also: self::_keyboard_interactive_process()
public string $last_interactive_response
return string

$last_packet public property

Time of first network activity
public int $last_packet
return integer

$log_boundary public property

Log Boundary
See also: self::_format_log()
public string $log_boundary
return string

$log_long_width public property

Log Long Width
See also: self::_format_log()
public int $log_long_width
return integer

$log_short_width public property

Log Short Width
See also: self::_format_log()
public int $log_short_width
return integer

$log_size public property

Should never exceed NET_SSH2_LOG_MAX_SIZE
See also: self::_send_binary_packet()
See also: self::_get_binary_packet()
public int $log_size
return integer

$mac_algorithms_client_to_server public property

MAC Algorithms: Client to Server
See also: self::getMACAlgorithmsClient2Server()
public array|false $mac_algorithms_client_to_server
return array | false

$mac_algorithms_server_to_client public property

MAC Algorithms: Server to Client
See also: self::getMACAlgorithmsServer2Client()
public array|false $mac_algorithms_server_to_client
return array | false

$message_log public property

Message Log
See also: self::getLog()
public array $message_log
return array

$message_number_log public property

Message Number Log
See also: self::getLog()
public array $message_number_log
return array

$message_numbers public property

Message Numbers
See also: self::Net_SSH2()
public array $message_numbers
return array

$packet_size_client_to_server public property

Maximum packet size indexed by channel
See also: self::_send_channel_packet()
public array $packet_size_client_to_server
return array

$port public property

Port Number
See also: self::Net_SSH2()
See also: self::_connect()
public int $port
return integer

$quiet_mode public property

Flag to suppress stderr from output
See also: self::enableQuietMode()
public $quiet_mode

$realtime_log_file public property

Real-time log file pointer
See also: self::_append_log()
public resource $realtime_log_file
return resource

$realtime_log_size public property

Real-time log file size
See also: self::_append_log()
public int $realtime_log_size
return integer

$realtime_log_wrap public property

Real-time log file wrap boolean
See also: self::_append_log()
public $realtime_log_wrap

$request_pty public property

Flag to request a PTY when using exec()
See also: self::enablePTY()
public bool $request_pty
return boolean

$send_seq_no public property

See 'Section 6.4. Data Integrity' of rfc4253 for more info.
See also: self::_send_binary_packet()
public int $send_seq_no
return integer

$server_channels public property

Maps client channels to server channels
See also: self::_get_channel_packet()
See also: self::exec()
public array $server_channels
return array

$server_host_key_algorithms public property

Server Host Key Algorithms
See also: self::getServerHostKeyAlgorithms()
public array|false $server_host_key_algorithms
return array | false

$server_identifier public property

Server Identifier
See also: self::getServerIdentification()
public array|false $server_identifier
return array | false

$server_public_host_key public property

Server Public Host Key
See also: self::getServerPublicHostKey()
public string $server_public_host_key
return string

$session_id public property

"The exchange hash H from the first key exchange is additionally used as the session identifier, which is a unique identifier for this connection." -- http://tools.ietf.org/html/rfc4253#section-7.2
See also: self::_key_exchange()
public string $session_id
return string

$signature public property

Verified against $this->session_id
See also: self::getServerPublicHostKey()
public string $signature
return string

$signature_format public property

ssh-rsa or ssh-dss.
See also: self::getServerPublicHostKey()
public string $signature_format
return string

$signature_validated public property

Has the signature been validated?
See also: self::getServerPublicHostKey()
public bool $signature_validated
return boolean

$stdErrorLog public property

Contents of stdError
public string $stdErrorLog
return string

$terminal_modes public property

Terminal Modes
See also: self::Net_SSH2()
public array $terminal_modes
return array

$timeout public property

Timeout
See also: self::setTimeout()
public $timeout

$windowColumns public property

Number of columns for terminal window size
See also: self::getWindowColumns()
See also: self::setWindowColumns()
See also: self::setWindowSize()
public int $windowColumns
return integer

$windowRows public property

Number of columns for terminal window size
See also: self::getWindowRows()
See also: self::setWindowRows()
See also: self::setWindowSize()
public int $windowRows
return integer

$window_size public property

Bytes the other party can send before it must wait for the window to be adjusted (0x7FFFFFFF = 2GB)
See also: self::_send_channel_packet()
See also: self::exec()
public int $window_size
return integer

$window_size_client_to_server public property

Window size indexed by channel
See also: self::_get_channel_packet()
public array $window_size_client_to_server
return array

$window_size_server_to_client public property

Window size indexed by channel
See also: self::_send_channel_packet()
public array $window_size_server_to_client
return array