Net_SSH1
[ class tree: Net_SSH1 ] [ index: Net_SSH1 ] [ all elements ]

Class: Net_SSH1

Source Location: /lib/3rdParty/phpseclib/Net/SSH1.php

Class Overview


Pure-PHP implementation of SSHv1.


Author(s):

Version:

  • 0.1.0

Methods



Class Details

[line 256]
Pure-PHP implementation of SSHv1.



Tags:

author:  Jim Wigginton <terrafrost@php.net>
version:  0.1.0
access:  public


[ Top ]


Class Methods


constructor Net_SSH1 [line 392]

Net_SSH1 Net_SSH1( String $host, [optional $port = 22], [optional $timeout = 10], [optional $cipher = NET_SSH1_CIPHER_3DES])

Default Constructor.

Connects to an SSHv1 server




Tags:

access:  public


Parameters:

String   $host  
optional   $port   Integer $port
optional   $timeout   Integer $timeout
optional   $cipher   Integer $cipher

[ Top ]

destructor __destruct [line 783]

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 770]

void disconnect( )

Disconnect



Tags:

access:  public


[ Top ]

method exec [line 610]

mixed exec( String $cmd)

Executes a command on a non-interactive shell, returns the output, and quits.

An SSH1 server will close the connection after a command has been executed on a non-interactive shell. SSH2 servers don't, however, this isn't an SSH2 client. The way this works, on the server, is by initiating a shell with the -s option, as discussed in the following links:

http://www.faqs.org/docs/bashman/bashref_65.html http://www.faqs.org/docs/bashman/bashref_62.html

To execute further commands, a new Net_SSH1 object will need to be created.

Returns false on failure and the output, otherwise.




Tags:

see:  Net_SSH1::interactiveRead()
see:  Net_SSH1::interactiveWrite()
access:  public


Parameters:

String   $cmd  

[ Top ]

method getHostKeyPublicExponent [line 1097]

String getHostKeyPublicExponent( [optional $raw_output = false])

Return the host key public exponent

Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, the raw bytes. This behavior is similar to PHP's md5() function.




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method getHostKeyPublicModulus [line 1112]

String getHostKeyPublicModulus( [optional $raw_output = false])

Return the host key public modulus

Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, the raw bytes. This behavior is similar to PHP's md5() function.




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method getServerIdentification [line 1155]

String getServerIdentification( )

Return the server identification.



Tags:

access:  public


[ Top ]

method getServerKeyPublicExponent [line 1067]

String getServerKeyPublicExponent( [optional $raw_output = false])

Return the server key public exponent

Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, the raw bytes. This behavior is similar to PHP's md5() function.




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method getServerKeyPublicModulus [line 1082]

String getServerKeyPublicModulus( [optional $raw_output = false])

Return the server key public modulus

Returns, by default, the base-10 representation. If $raw_output is set to true, returns, instead, the raw bytes. This behavior is similar to PHP's md5() function.




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method getSupportedAuthentications [line 1144]

Array getSupportedAuthentications( [optional $raw_output = false])

Return a list of authentications supported by SSH1 server.

Just because a cipher is supported by an SSH1 server doesn't mean it's supported by this library. If $raw_output is set to true, returns, instead, an array of constants. ie. instead of array('password authentication'), you'll get array(NET_SSH1_AUTH_PASSWORD).




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method getSupportedCiphers [line 1128]

Array getSupportedCiphers( [optional $raw_output = false])

Return a list of ciphers supported by SSH1 server.

Just because a cipher is supported by an SSH1 server doesn't mean it's supported by this library. If $raw_output is set to true, returns, instead, an array of constants. ie. instead of array('Triple-DES in CBC mode'), you'll get array(NET_SSH1_CIPHER_3DES).




Tags:

access:  public


Parameters:

optional   $raw_output   Boolean $raw_output

[ Top ]

method interactiveRead [line 743]

String interactiveRead( )

Reads the output of an interactive shell.

Requires PHP 4.3.0 or later due to the use of the stream_select() function. If you see stuff like "", you're seeing ANSI escape codes. According to How to Enable ANSI.SYS in a Command Window, "Windows NT does not support ANSI escape sequences in Win32 Console applications", so if you're a Windows user, there's not going to be much recourse.




Tags:

see:  Net_SSH1::interactiveRead()
access:  public


[ Top ]

method interactiveWrite [line 708]

Boolean interactiveWrite( String $cmd)

Inputs a command into an interactive shell.



Tags:

see:  Net_SSH1::interactiveRead()
access:  public


Parameters:

String   $cmd  

[ Top ]

method login [line 547]

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

Login



Tags:

access:  public


Parameters:

String   $username  
optional   $password   String $password

[ Top ]


Documentation generated on Sat, 12 Feb 2011 16:36:38 +0100 by phpDocumentor 1.4.1