Net_SSH2

# Procedural File: SSH2.php

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

## Classes:

Net_SSH2
  Pure-PHP implementation of SSHv2.

## Page Details:

Pure-PHP implementation of SSHv2.

PHP versions 4 and 5

Here are some examples of how to use this library:

1. <?php
2. include('Net/SSH2.php');
4. $ssh = new Net_SSH2 ('www.domain.tld');
5. if (!$ssh->login('username', 'password')) {
6. exit('Login Failed');
7. }
9. echo $ssh-> exec ('pwd');
10. echo $ssh-> exec ('ls -la');
11. ?>

1. <?php
2. include('Crypt/RSA.php');
3. include('Net/SSH2.php');
5. $key = new Crypt_RSA ();
6. //$key->setPassword('whatever');
7. $key->loadKey( file_get_contents ('privatekey'));
9. $ssh = new Net_SSH2 ('www.domain.tld');
10. if (!$ssh->login('username', $key)) {
11. exit('Login Failed');
12. }
14. echo $ssh-> exec ('pwd');
15. echo $ssh-> exec ('ls -la');
16. ?>

LICENSE: This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

#### Tags:

author: | Jim Wigginton <terrafrost@php.net>
version: | $Id: SSH2.php,v 1.1 2010/05/14 14:06:16 gruberroland Exp $
copyright: | MMVII Jim Wigginton
link: | http://phpseclib.sourceforge.net
license: | http://www.gnu.org/licenses/lgpl.txt

#### Includes:

require_once('Crypt/RC4.php') [line 92]
Include Crypt_RC4
require_once('Crypt/TripleDES.php') [line 87]
Include Crypt_TripleDES
require_once('Math/BigInteger.php') [line 72]
Include Math_BigInteger

Used to do Diffie-Hellman key exchange and DSA/RSA signature verification.

require_once('Crypt/AES.php') [line 97]
Include Crypt_AES
require_once('Crypt/Random.php') [line 77]
Include Crypt_Random
require_once('Crypt/Hash.php') [line 82]
Include Crypt_Hash

### NET_SSH2_LOG_COMPLEX [line 139]

`NET_SSH2_LOG_COMPLEX = 2`

Returns the message content

#### Tags:

see: | Net_SSH2::getLog()
access: | public

[ Top ]

### NET_SSH2_LOG_SIMPLE [line 135]

`NET_SSH2_LOG_SIMPLE = 1`

Returns the message numbers

#### Tags:

see: | Net_SSH2::getLog()
access: | public

[ Top ]

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