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

### Child classes:

Net_SFTP
  Pure-PHP implementations of SFTP.

### Class Details

[line 150]
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 577]

`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 1519]

`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 1506]

`void disconnect( )`

Disconnect

#### Tags:

access: | public

[ Top ]

### method exec [line 1434]

`String exec( String $command)`

Execute Command

#### Tags:

access: | public

#### Parameters:

String | $command |

[ Top ]

### method getCompressionAlgorithmsClient2Server [line 2142]

`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 2153]

`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 2098]

`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 2109]

`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 2043]

`String getErrors( )`

Returns all errors

#### Tags:

access: | public

[ Top ]

### method getKexAlgorithms [line 2076]

`Array getKexAlgorithms( )`

Return a list of the key exchange algorithms the server supports.

#### Tags:

access: | public

[ Top ]

### method getLanguagesClient2Server [line 2175]

`Array getLanguagesClient2Server( )`

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

#### Tags:

access: | public

[ Top ]

### method getLanguagesServer2Client [line 2164]

`Array getLanguagesServer2Client( )`

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

#### Tags:

access: | public

[ Top ]

### method getLastError [line 2054]

`String getLastError( )`

Returns the last error

#### Tags:

access: | public

[ Top ]

### method getLog [line 1977]

`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 2120]

`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 2131]

`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 2087]

`Array getServerHostKeyAlgorithms( )`

Return a list of the host key (public key) algorithms the server supports.

#### Tags:

access: | public

[ Top ]

### method getServerIdentification [line 2065]

`String getServerIdentification( )`

Return the server identification.

#### Tags:

access: | public

[ Top ]

### method getServerPublicHostKey [line 2189]

`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 1260]

`Boolean login( String $username, [optional $password = ''])`

Login

#### Tags:

access: | public

Overridden in child classes as:

Net_SFTP::login()
  Login

#### Parameters:

String | $username |
optional | $password | String $password

[ Top ]

Documentation generated on Thu, 28 Oct 2010 21:00:37 +0200 by phpDocumentor 1.4.1