Download the PHP package divineomega/php-ssh-connection without Composer

On this page you can find all versions of the php package divineomega/php-ssh-connection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-ssh-connection

PHP SSH Connection

Tests Packagist

The PHP SSH Connection package provides an elegant syntax to connect to SSH servers and execute commands. It supports password and public-private key authentication, and can capture command output and errors.

Supported runtimes: PHP 7.2+ and PHP 8.x.

Installation

Install with Composer:

Usage

Running multiple commands

Each run() call executes in a fresh shell context. If you need stateful command execution (for example cd then touch), use runCommands():

Fingerprint verification

For security, obtain the server's SHA-256 fingerprint through a trusted out-of-band channel and configure it before connecting. Verification happens before a password or private key is sent to the server.

The SHA256: prefix and base64 padding are optional when configuring the expected value. MD5 values may be supplied with or without colons.

Available fingerprint types:

SHA-256 and MD5 match the standard OpenSSH fingerprint algorithms. SHA-1 and SHA-512 remain available as hexadecimal hashes of the SSH wire key for callers that previously selected those constants. The no-argument fingerprint() call still defaults to MD5 for source compatibility; SHA-256 is recommended for new code.

Private key passphrases

Pass a private-key passphrase as the second argument for either file or string keys:

Timeouts

timeout() now applies to the initial socket connection and authentication as well as subsequent command and SFTP activity. A timeout of zero disables the operation timeout; negative values are rejected.

File transfer safety

Uploads and downloads both use SFTP. Recursive directory downloads refuse to follow remote symbolic links, preventing cycles and unexpected traversal outside the requested tree.

Compatibility

PHP 7.2 through the current PHP 8.x releases are supported. Version 5 uses the actively maintained phpseclib 3.x line.

Upgrading to 5.0

Testing

The package test suite includes SSH integration tests. Set these variables before running tests:

Then run:


All versions of php-ssh-connection with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
phpseclib/phpseclib Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package divineomega/php-ssh-connection contains the following files

Loading the files please wait ...