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: <?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'); ?> <?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->read('username@username:~$'); $ssh->write("ls -la\n"); echo $ssh->read('username@username:~$'); ?> LICENSE: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #### Tags:
author: | Jim Wigginton <terrafrost@php.net>
version: | $Id: SSH2.php,v 1.3 2011/05/31 16:32:25 gruberroland Exp $
copyright: | MMVII Jim Wigginton
link: | http://phpseclib.sourceforge.net
license: | MIT License
#### Includes: require_once('Crypt/RC4.php') [line 96] Include Crypt_RC4 require_once('Crypt/AES.php') [line 101] Include Crypt_AES require_once('Math/BigInteger.php') [line 76] Include Math_BigInteger Used to do Diffie-Hellman key exchange and DSA/RSA signature verification. require_once('Crypt/TripleDES.php') [line 91] Include Crypt_TripleDES require_once('Crypt/Random.php') [line 81] Include Crypt_Random require_once('Crypt/Hash.php') [line 86] Include Crypt_Hash ### NET_SSH2_LOG_COMPLEX [line 145]
`NET_SSH2_LOG_COMPLEX = 2`
Returns the message content #### Tags:
see: | Net_SSH2::getLog()
access: | public
[ Top ] ### NET_SSH2_LOG_SIMPLE [line 141]
`NET_SSH2_LOG_SIMPLE = 1`
Returns the message numbers #### Tags:
see: | Net_SSH2::getLog()
access: | public
[ Top ] ### NET_SSH2_READ_REGEX [line 159]
`NET_SSH2_READ_REGEX = 2`
Returns when a string matching the regular expression $expect is found #### Tags:
see: | Net_SSH2::read()
access: | public
[ Top ] ### NET_SSH2_READ_SIMPLE [line 155]
`NET_SSH2_READ_SIMPLE = 1`
Returns when a string matching $expect exactly is found #### Tags:
see: | Net_SSH2::read()
access: | public
[ Top ] Documentation generated on Tue, 22 Nov 2011 16:30:12 +0100 by phpDocumentor 1.4.1