{"id":15984868,"url":"https://github.com/divineomega/php-ssh-connection","last_synced_at":"2025-04-05T23:12:32.583Z","repository":{"id":55119645,"uuid":"199535632","full_name":"DivineOmega/php-ssh-connection","owner":"DivineOmega","description":"Provides an elegant syntax to connect to SSH servers and execute commands.","archived":false,"fork":false,"pushed_at":"2023-06-21T07:49:34.000Z","size":47,"stargazers_count":110,"open_issues_count":5,"forks_count":22,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T22:10:01.659Z","etag":null,"topics":["php","ssh","ssh-client","ssh-client-library"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DivineOmega.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-29T22:38:28.000Z","updated_at":"2025-01-06T11:19:22.000Z","dependencies_parsed_at":"2024-06-18T14:05:09.270Z","dependency_job_id":"48b4717d-ed5a-445b-9285-a98b0c908afd","html_url":"https://github.com/DivineOmega/php-ssh-connection","commit_stats":{"total_commits":64,"total_committers":5,"mean_commits":12.8,"dds":0.203125,"last_synced_commit":"d6c8326cf376777df828372e494dc1b6a1be2a89"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-ssh-connection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-ssh-connection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-ssh-connection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DivineOmega%2Fphp-ssh-connection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DivineOmega","download_url":"https://codeload.github.com/DivineOmega/php-ssh-connection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411239,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","ssh","ssh-client","ssh-client-library"],"created_at":"2024-10-08T02:10:53.521Z","updated_at":"2025-04-05T23:12:32.551Z","avatar_url":"https://github.com/DivineOmega.png","language":"PHP","readme":"# PHP SSH Connection\n\n[![Build Status](https://travis-ci.com/DivineOmega/php-ssh-connection.svg?branch=master)](https://travis-ci.com/DivineOmega/php-ssh-connection)\n[![Coverage Status](https://coveralls.io/repos/github/DivineOmega/php-ssh-connection/badge.svg?branch=master)](https://coveralls.io/github/DivineOmega/php-ssh-connection?branch=master)\n\nThe PHP SSH Connection package provides an elegant syntax to connect to SSH servers and execute commands. It supports both password and public-private keypair authentication, and can easily capture command output and errors.\n\n## Installation\n\nYou can install the PHP SSH Connection package by running the following Composer command.\n\n```bash\ncomposer require divineomega/php-ssh-connection\n```\n\n## Usage\n\nSee the following basic usage instructions.\n\n```php\n$connection = (new SSHConnection())\n            -\u003eto('test.rebex.net')\n            -\u003eonPort(22)\n            -\u003eas('demo')\n            -\u003ewithPassword('password')\n         // -\u003ewithPrivateKey($privateKeyPath)\n         // -\u003etimeout(0)\n            -\u003econnect();\n\n$command = $connection-\u003erun('echo \"Hello world!\"');\n\n$command-\u003egetOutput();  // 'Hello World'\n$command-\u003egetError();   // ''\n\n$connection-\u003eupload($localPath, $remotePath);\n$connection-\u003edownload($remotePath, $localPath);\n```\n\nFor security, you can fingerprint the remote server and verify the fingerprint remains the same \nupon each subsequent connection.\n\n```php\n$fingerprint = $connection-\u003efingerprint();\n\nif ($newConnection-\u003efingerprint() != $fingerprint) {\n    throw new Exception('Fingerprint does not match!');\n}\n```\n\nIf you wish, you can specify the type of fingerprint you wish to retrieve.\n\n```php\n$md5Fingerprint  = $connection-\u003efingerprint(SSHConnection::FINGERPRINT_MD5); // default\n$sha1Fingerprint = $connection-\u003efingerprint(SSHConnection::FINGERPRINT_SHA1);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fphp-ssh-connection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivineomega%2Fphp-ssh-connection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivineomega%2Fphp-ssh-connection/lists"}