{"id":16908815,"url":"https://github.com/wiardvanrij/sshwrapper","last_synced_at":"2025-04-11T15:42:22.237Z","repository":{"id":57080501,"uuid":"107791788","full_name":"wiardvanrij/sshwrapper","owner":"wiardvanrij","description":"This library allows you to connect via SSH to your linux server with the PHP core class 'ssh2'. It also allows to use a \"jump server\"","archived":false,"fork":false,"pushed_at":"2017-10-21T18:32:40.000Z","size":10,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T07:54:57.558Z","etag":null,"topics":["php","php-library","php7","ssh","ssh-client"],"latest_commit_sha":null,"homepage":"https://www.sysrant.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiardvanrij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-21T15:28:09.000Z","updated_at":"2022-03-25T13:14:09.000Z","dependencies_parsed_at":"2022-08-24T14:57:31.601Z","dependency_job_id":null,"html_url":"https://github.com/wiardvanrij/sshwrapper","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fsshwrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fsshwrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fsshwrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiardvanrij%2Fsshwrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiardvanrij","download_url":"https://codeload.github.com/wiardvanrij/sshwrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248433203,"owners_count":21102529,"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","php-library","php7","ssh","ssh-client"],"created_at":"2024-10-13T18:53:05.901Z","updated_at":"2025-04-11T15:42:22.209Z","avatar_url":"https://github.com/wiardvanrij.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSH wrapper for PHP\n\n## Information\n\n!!! This is in very beta. I would not recommend using this on production or whatsoever. !!!\n\nThis library allows you to connect via SSH to your linux server with the PHP core class 'ssh2'.\nIt also allows to use a \"jump server\" for instance:\n\n    command --ssh to-\u003e jump server --ssh to-\u003e actual server\n    \n## Requirements\n    \nYou will need to install the PHP ssh2 extension and enable this. I assume you have knowledge on how to install php extensions\n     \n     \n## Installation\n\nVia composer\n\n    {\n        \"require\": {\n            \"wiardvanrij/sshwrapper\": \"*\"\n        }\n    }\n\nBecause this library is in beta, please use the latest version. There is no stable\n\n## Usage\n\nRequire the autoloader and include the namespace\n\n    \u003c?php\n    \n    require('vendor/autoload.php');\n    \n    use SshWrapper\\SshCore;\n    \nInitiate the class with the host\n    \n    $ssh = new SshCore('123.123.123.123');\n    \nOptional: Define the rsa public and private key locations if they differ from default. Defaults:\n    \n    $ssh-\u003eauthPriv = '~/.ssh/id_rsa';\n    $ssh-\u003eauthPub = '~/.ssh/id_rsa.pub';\n    \nOptional: Define user and port if they differ from the default. Defaults:    \n\n    $ssh-\u003eauthUser = 'root';\n    $ssh-\u003eport = 22;\n    \nPrefered: If you use the ssh server as \"jump server\" you can define the actual server here including the user.\n    \n    $ssh-\u003ejumphost = 'root@321.321.321.321';\n    \nConnect    \n    \n    $ssh-\u003econnect();\n    \nAnd execute a command\n    \n    $result = $ssh-\u003eexec('ls -lah');\n    \n    var_dump($result);\n    \nResult is a string of the output\n\nDisconnect to close the ssh connection\n\n    $ssh-\u003edisconnect();\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiardvanrij%2Fsshwrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiardvanrij%2Fsshwrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiardvanrij%2Fsshwrapper/lists"}