355c42cb30
Conflicts: include/config.php update.php
2302 lines
85 KiB
PHP
2302 lines
85 KiB
PHP
<?php
|
|
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
|
|
|
|
/**
|
|
* Pure-PHP implementation of SSHv2.
|
|
*
|
|
* PHP versions 4 and 5
|
|
*
|
|
* Here are some examples of how to use this library:
|
|
* <code>
|
|
* <?php
|
|
* include('Net/SSH2.php');
|
|
*
|
|
* $ssh = new Net_SSH2('www.domain.tld');
|
|
* if (!$ssh->login('username', 'password')) {
|
|
* exit('Login Failed');
|
|
* }
|
|
*
|
|
* echo $ssh->exec('pwd');
|
|
* echo $ssh->exec('ls -la');
|
|
* ?>
|
|
* </code>
|
|
*
|
|
* <code>
|
|
* <?php
|
|
* include('Crypt/RSA.php');
|
|
* include('Net/SSH2.php');
|
|
*
|
|
* $key = new Crypt_RSA();
|
|
* //$key->setPassword('whatever');
|
|
* $key->loadKey(file_get_contents('privatekey'));
|
|
*
|
|
* $ssh = new Net_SSH2('www.domain.tld');
|
|
* if (!$ssh->login('username', $key)) {
|
|
* exit('Login Failed');
|
|
* }
|
|
*
|
|
* echo $ssh->exec('pwd');
|
|
* echo $ssh->exec('ls -la');
|
|
* ?>
|
|
* </code>
|
|
*
|
|
* 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
|
|
*
|
|
* @category Net
|
|
* @package Net_SSH2
|
|
* @author Jim Wigginton <terrafrost@php.net>
|
|
* @copyright MMVII Jim Wigginton
|
|
* @license http://www.gnu.org/licenses/lgpl.txt
|
|
* @version $Id: SSH2.php,v 1.46 2010/04/27 21:29:36 terrafrost Exp $
|
|
* @link http://phpseclib.sourceforge.net
|
|
*/
|
|
|
|
/**
|
|
* Include Math_BigInteger
|
|