{"id":19533643,"url":"https://github.com/oliwierptak/flysystem-ssh-shell","last_synced_at":"2025-04-26T13:33:51.328Z","repository":{"id":48356288,"uuid":"191970458","full_name":"oliwierptak/flysystem-ssh-shell","owner":"oliwierptak","description":"SSH/Shell adapter for league/flysystem","archived":false,"fork":false,"pushed_at":"2024-11-06T19:21:01.000Z","size":183,"stargazers_count":6,"open_issues_count":3,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-14T18:22:38.178Z","etag":null,"topics":["adpter","filesystem","flysystem","flysystem-adapter","php","sh","shell","ssh"],"latest_commit_sha":null,"homepage":null,"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/oliwierptak.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}},"created_at":"2019-06-14T15:54:30.000Z","updated_at":"2023-08-05T07:12:31.000Z","dependencies_parsed_at":"2022-09-17T16:00:49.092Z","dependency_job_id":null,"html_url":"https://github.com/oliwierptak/flysystem-ssh-shell","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fflysystem-ssh-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fflysystem-ssh-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fflysystem-ssh-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliwierptak%2Fflysystem-ssh-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliwierptak","download_url":"https://codeload.github.com/oliwierptak/flysystem-ssh-shell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250993642,"owners_count":21519701,"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":["adpter","filesystem","flysystem","flysystem-adapter","php","sh","shell","ssh"],"created_at":"2024-11-11T02:09:01.909Z","updated_at":"2025-04-26T13:33:51.053Z","avatar_url":"https://github.com/oliwierptak.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flysystem-ssh-shell\n\nFlysystem adapter for SSH shell.\n \n### Installation\n\n```bash\ncomposer require phuxtil/flysystem-ssh-shell \n```\n\n_Note_: Use v1.x for compatibility with PHP v7.0.x\n_Note_: Use v2.x for compatibility with PHP v7.2+\n\n### Requirements\n\nThe following programs installed and configured on local host:\n- ssh\n- scp\n\nThe following programs installed on the remote host:\n- find\n- cat\n- stat\n- rmdir\n- mkdir\n- chmod\n- mv\n- rm\n- sh compatible shell\n\n### Configuration\n\nUse `\\Phuxtil\\Flysystem\\SshShell\\SshShellConfigurator` to pass options to adapter.\n\n```php\n$configurator = (new \\Phuxtil\\Flysystem\\SshShell\\SshShellConfigurator())\n    -\u003esetRoot('/remote_server/path')\n    -\u003esetUser('remote_user')\n    -\u003esetHost('remote-ssh-host')\n    -\u003esetPrivateKey('path/to/id_rsa.private_key')\n    -\u003esetPort(22);\n```\n\n### Authentication\n\nTwo authentication methods are supported:\n\n#### via ssh config\n\nThe value of `user@host` is configured in ssh config file.\n\n```php\n$configurator = (new \\Phuxtil\\Flysystem\\SshShell\\SshShellConfigurator())\n    -\u003esetUser('user')\n    -\u003esetHost('host');\n```\n_Note: This is the default setting._\n\n#### via ssh private key \n\n```php\n$configurator = (new \\Phuxtil\\Flysystem\\SshShell\\SshShellConfigurator())\n    -\u003esetUser('user')\n    -\u003esetHost('host')\n    -\u003esetPrivateKey('path/to/id_rsa.private_key');\n```\nPassed as `-i` option to ssh/scp.\n\n_Note: To revert to default setting, unset private key value._\n\n\n\n### Bootstrap\n\n``` php\n\u003c?php\n\nuse League\\Flysystem\\Filesystem;\nuse Phuxtil\\Flysystem\\SshShell\\SshShellConfigurator;\nuse Phuxtil\\Flysystem\\SshShell\\SshShellFactory;\n\n\\error_reporting(\\E_ALL);\n\ninclude __DIR__ . '/vendor/autoload.php';\n\n$configurator = (new SshShellConfigurator())\n    -\u003esetRoot('/tmp/remote_fs')\n    -\u003esetUser('user')\n    -\u003esetHost('host');\n\n$adapter = (new SshShellFactory())-\u003ecreateAdapter($configurator);\n\n$filesystem = new Filesystem($adapter);\n\n```\n\n\n### TDD\n\nDefault root directory on remote host is `/tmp/remote_fs`.\n\nAvailable parameters:\n- `TESTS_SSH_USER` \n- `TESTS_SSH_HOST`\n- `TEST_SSH_PORT` (optional, default 22)\n\nRun tests with:\n\n```shell\nTESTS_SSH_USER=... TESTS_SSH_HOST=... vendor/bin/phpunit --group acceptance\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliwierptak%2Fflysystem-ssh-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliwierptak%2Fflysystem-ssh-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliwierptak%2Fflysystem-ssh-shell/lists"}