Net_SSH2

# Class: Net_SSH2 Source Location: /lib/3rdParty/phpseclib/Net/SSH2.php
### Class Overview
Pure-PHP implementation of SSHv2. #### Author(s): Jim Wigginton <terrafrost@php.net> #### Version: 0.1.0 | ### Methods Net_SSH2 __destruct disconnect exec getCompressionAlgorithmsClient2Server getCompressionAlgorithmsServer2Client getEncryptionAlgorithmsClient2Server getEncryptionAlgorithmsServer2Client getErrors getKexAlgorithms getLanguagesClient2Server getLanguagesServer2Client getLastError getLog getMACAlgorithmsClient2Server getMACAlgorithmsServer2Client getServerHostKeyAlgorithms getServerIdentification getServerPublicHostKey login read write
### Child classes: Net_SFTP Pure-PHP implementations of SFTP.
### Class Details [line 170] Pure-PHP implementation of SSHv2. #### Tags:
author: | Jim Wigginton <terrafrost@php.net>
version: | 0.1.0
access: | public
[ Top ] ### Class Methods ### constructor Net_SSH2 [line 617]
`Net_SSH2 Net_SSH2( String $host, [optional $port = 22], [optional $timeout = 10])`
Default Constructor. Connects to an SSHv2 server #### Tags:
access: | public
#### Parameters:
String | $host |
optional | $port | Integer $port
optional | $timeout | Integer $timeout
[ Top ] ### destructor __destruct [line 1837]
`void __destruct( )`
Destructor. Will be called, automatically, if you're supporting just PHP5. If you're supporting PHP4, you'll need to call disconnect(). #### Tags:
access: | public
[ Top ] ### method disconnect [line 1824]
`void disconnect( )`
Disconnect #### Tags:
access: | public
[ Top ] ### method exec [line 1611]
`String exec( String $command, [optional $block = true])`
Execute Command If $block 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. #### Tags:
access: | public
#### Parameters:
String | $command |
optional | $block | Boolean $block
[ Top ] ### method getCompressionAlgorithmsClient2Server [line 2500]
`Array getCompressionAlgorithmsClient2Server( )`
Return a list of the compression algorithms the server supports, when receiving stuff from the client. #### Tags:
access: | public
[ Top ] ### method getCompressionAlgorithmsServer2Client [line 2511]
`Array getCompressionAlgorithmsServer2Client( )`
Return a list of the compression algorithms the server supports, when sending stuff to the client. #### Tags:
access: | public
[ Top ] ### method getEncryptionAlgorithmsClient2Server [line 2456]
`Array getEncryptionAlgorithmsClient2Server( )`
Return a list of the (symmetric key) encryption algorithms the server supports, when receiving stuff from the client. #### Tags:
access: | public
[ Top ] ### method getEncryptionAlgorithmsServer2Client [line 2467]
`Array getEncryptionAlgorithmsServer2Client( )`
Return a list of the (symmetric key) encryption algorithms the server supports, when sending stuff to the client. #### Tags:
access: | public
[ Top ] ### method getErrors [line 2401]
`String getErrors( )`
Returns all errors #### Tags:
access: | public
[ Top ] ### method getKexAlgorithms [line 2434]
`Array getKexAlgorithms( )`
Return a list of the key exchange algorithms the server supports. #### Tags:
access: | public
[ Top ] ### method getLanguagesClient2Server [line 2533]
`Array getLanguagesClient2Server( )`
Return a list of the languages the server supports, when receiving stuff from the client. #### Tags:
access: | public
[ Top ] ### method getLanguagesServer2Client [line 2522]
`Array getLanguagesServer2Client( )`
Return a list of the languages the server supports, when sending stuff to the client. #### Tags:
access: | public
[ Top ] ### method getLastError [line 2412]
`String getLastError( )`
Returns the last error #### Tags:
access: | public
[ Top ] ### method getLog [line 2335]
`String getLog( )`
Returns a log of the packets that have been sent and received. 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') #### Tags:
return: | or Array
access: | public
[ Top ] ### method getMACAlgorithmsClient2Server [line 2478]
`Array getMACAlgorithmsClient2Server( )`
Return a list of the MAC algorithms the server supports, when receiving stuff from the client. #### Tags:
access: | public
[ Top ] ### method getMACAlgorithmsServer2Client [line 2489]
`Array getMACAlgorithmsServer2Client( )`
Return a list of the MAC algorithms the server supports, when sending stuff to the client. #### Tags:
access: | public
[ Top ] ### method getServerHostKeyAlgorithms [line 2445]
`Array getServerHostKeyAlgorithms( )`
Return a list of the host key (public key) algorithms the server supports. #### Tags:
access: | public
[ Top ] ### method getServerIdentification [line 2423]
`String getServerIdentification( )`
Return the server identification. #### Tags:
access: | public
[ Top ] ### method getServerPublicHostKey [line 2547]
`Mixed getServerPublicHostKey( )`
Returns the server public host key. 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. #### Tags:
access: | public
[ Top ] ### method login [line 1309]
`Boolean login( String $username, [optional $password = ''])`
Login The $password parameter can be a plaintext password or a Crypt_RSA object. #### Tags:
access: | public
Overridden in child classes as: Net_SFTP::login() Login #### Parameters:
String | $username |
optional | $password | String $password
[ Top ] ### method read [line 1768]
`String read( String $expect, [Integer $mode = NET_SSH2_READ_SIMPLE])`
Returns the output of an interactive shell 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. #### Tags:
see: | Net_SSH2::read()
access: | public
#### Parameters:
String | $expect |
Integer | $mode |
[ Top ] ### method write [line 1804]
`Boolean write( String $cmd)`
Inputs a command into an interactive shell. #### Tags:
see: | Net_SSH1::interactiveWrite()
access: | public
#### Parameters:
String | $cmd |
[ Top ] Documentation generated on Tue, 22 Nov 2011 16:30:12 +0100 by phpDocumentor 1.4.1