bravo3 / ssh
Interactive SSH2 suite for PHP 5.4
Installs: 1 040
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 8
Forks: 1
Open Issues: 0
Requires
- php: >=5.4.0
- ext-ssh2: *
- bravo3/standards: ~1.0
Requires (Dev)
- ext-openssl: *
- phpunit/phpunit: >=4.0.0
Suggests
- ext-openssl: To allow the use of private keys without public keys
This package is not auto-updated.
Last update: 2024-11-09 15:50:09 UTC
README
This module is a PHP wrapper for the libssh2 extension with support for interactive sessions. With interactive session support you can mimic a user terminal allowing you access to things such as sudo which might not typically be available to remote sessions. Unlike most libssh2 libraries, you do not need a public key file to authenticate using keys pairs.
Installation
This project requires PHP-SSH2, which can be installed with pecl
:
yum install libssh2-devel
# apt-get install libssh2-1-dev
yes '' | pecl install -f ssh2
echo "extension=ssh2.so" > /etc/php.d/ssh2.ini
# echo "extension=ssh2.so" > /etc/php5/mods-available/ssh2.ini
# ln -s /etc/php5/mods-available/ssh2.ini /etc/php5/apache2/conf.d/20-ssh2.ini
# ln -s /etc/php5/mods-available/ssh2.ini /etc/php5/cli/conf.d/20-ssh2.ini
Usage
History
1.4.2
- Added timeout & line-ending normalisation to smart commands
1.4.1
- Added the ability to detect remote shell type
- Smart commands now work on C-shell variants
- Added pause timeouts to all other shell read functions
- Added the ability to normalise line-endings in shell output
1.4.0
- Deprecated version 1.3.x
- Fixed logic of the ssh2_tunnel() function
1.3.0
- Added support to tunnel connections
1.2.0
- Added ability to connect using just a private PEM key
1.1.0
- Added SCP support
Known Bugs/Limitations
Bugs
This wrapper is subject to the same bugs that exist in the ssh2 extension, notable of those are the encrypted private key files running in Ubuntu/Debian:
- https://bugs.php.net/bug.php?id=58573
- See Encrypted Private Keys for workaround
Limitations
Features implemented:
- Password and key-pair authentication
- Optional fingerprint checking
- Command execution
- Interactive shell (mimic user)
- SCP transfers
- Public key generation (connect using just a private key)
- Tunnels (remote connections)
Notable features not implemented:
- Agent and host authentication
- SFTP transfers