{"id":13499365,"url":"https://github.com/moul/ssh2docker","last_synced_at":"2025-04-04T12:09:16.749Z","repository":{"id":47727857,"uuid":"41324093","full_name":"moul/ssh2docker","owner":"moul","description":":whale: standalone SSH server that connects you to your Docker containers","archived":false,"fork":false,"pushed_at":"2025-02-12T21:34:42.000Z","size":4929,"stargazers_count":190,"open_issues_count":24,"forks_count":18,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-28T11:11:09.154Z","etag":null,"topics":["docker","gateway","hook-script","ssh","ssh-server"],"latest_commit_sha":null,"homepage":"https://manfred.life/ssh2docker","language":"Go","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/moul.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},"funding":{"github":["moul"],"patreon":"moul","open_collective":"moul","custom":["https://manfred.life/donate"]}},"created_at":"2015-08-24T19:58:18.000Z","updated_at":"2025-02-21T06:49:31.000Z","dependencies_parsed_at":"2025-02-24T07:11:32.342Z","dependency_job_id":"6f150025-8f29-4e73-8427-8a718582b095","html_url":"https://github.com/moul/ssh2docker","commit_stats":{"total_commits":122,"total_committers":4,"mean_commits":30.5,"dds":0.0901639344262295,"last_synced_commit":"5ae43b366d285be733a23b26fb2abf8e7775eba6"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fssh2docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fssh2docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fssh2docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moul%2Fssh2docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moul","download_url":"https://codeload.github.com/moul/ssh2docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174423,"owners_count":20896078,"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":["docker","gateway","hook-script","ssh","ssh-server"],"created_at":"2024-07-31T22:00:32.506Z","updated_at":"2025-04-04T12:09:16.732Z","avatar_url":"https://github.com/moul.png","language":"Go","readme":"# ssh2docker\n:wrench: SSH server that can create new Docker containers and/or join existing ones, with session, and dynamic configuration support \n\n\u003e SSH chroot with steroids\n\n[![Build Status](https://travis-ci.org/moul/ssh2docker.svg?branch=master)](https://travis-ci.org/moul/ssh2docker)\n[![GoDoc](https://godoc.org/github.com/moul/ssh2docker?status.svg)](https://godoc.org/github.com/moul/ssh2docker)\n[![License](https://img.shields.io/github/license/moul/ssh2docker.svg)](https://github.com/moul/ssh2docker/blob/master/LICENSE)\n\n![](https://raw.githubusercontent.com/moul/ssh2docker/master/resources/ssh2docker.png)\n\n```ruby\n┌────────────┐\n│bobby@laptop│\n└────────────┘\n       │\n       └──ssh container1@mycorp.biz──┐\n                                     ▼\n                               ┌──────────┐\n┌──────────────────────────────┤ssh2docker├──┐\n│                              └──────────┘  │\n│              docker exec -it       │       │\n│                 container1         │       │\n│          ┌──────/bin/bash──────────┘       │\n│ ┌────────┼───────────────────────────────┐ │\n│ │docker  │                               │ │\n│ │┌───────▼──┐ ┌──────────┐ ┌──────────┐  │ │\n│ ││container1│ │container2│ │container3│  │ │\n│ │└──────────┘ └──────────┘ └──────────┘  │ │\n│ └────────────────────────────────────────┘ │\n└────────────────────────────────────────────┘\n```\n\n## Usage\n\n```\nNAME:\n   ssh2docker - SSH portal to Docker containers\n\nUSAGE:\n   ssh2docker [global options] command [command options] [arguments...]\n\nAUTHOR(S):\n   Manfred Touron \u003chttps://github.com/moul/ssh2docker\u003e\n\nCOMMANDS:\n   help, h\tShows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --verbose, -V                 Enable verbose mode\n   --syslog-server               Configure a syslog server, i.e: udp://localhost:514\n   --bind, -b \":2222\"            Listen to address\n   --host-key, -k \"built-in\"     Path or complete SSH host key to use, use 'system' for keys in /etc/ssh\n   --allowed-images              List of allowed images, i.e: alpine,ubuntu:trusty,1cf3e6c\n   --shell \"/bin/sh\"             DEFAULT shell\n   --docker-run-args \"-it --rm\"  'docker run' arguments\n   --no-join                     Do not join existing containers, always create new ones\n   --clean-on-startup            Cleanup Docker containers created by ssh2docker on start\n   --password-auth-script \t     Password auth hook file\n   --publickey-auth-script \t     Public-key auth hook file\n   --local-user \t\t         If setted, you can spawn a local shell (not withing docker) by SSHing to this user\n   --banner \t\t\t         Display a banner on connection\n   --help, -h\t\t\t         show help\n   --version, -v\t\t         print the version\n```\n\n## Example\n\nServer\n\n```console\n$ ssh2docker\nINFO[0000] Listening on port 2222\nINFO[0001] NewClient (0): User=\"alpine\", ClientVersion=\"5353482d322e302d4f70656e5353485f362e362e317031205562756e74752d327562756e747532\"\nINFO[0748] NewClient (1): User=\"ubuntu\", ClientVersion=\"5353482d322e302d4f70656e5353485f362e362e317031205562756e74752d327562756e747532\"\n```\n\nClient\n\n```console\n$ ssh localhost -p 2222 -l alpine\nHost key fingerprint is 59:46:d7:cf:ca:33:be:1f:58:fd:46:c8:ca:5d:56:03\n+--[ RSA 2048]----+\n|          . .E   |\n|         . .  o  |\n|          o    +.|\n|         +   . .*|\n|        S    .oo=|\n|           . oB+.|\n|            oo.+o|\n|              ...|\n|              .o.|\n+-----------------+\n\nalpine@localhost's password:\n/ # cat /etc/alpine-release\n3.2.0\n/ # ^D\n```\n\n```console\n$ ssh localhost -p 2222 -l ubuntu\nHost key fingerprint is 59:46:d7:cf:ca:33:be:1f:58:fd:46:c8:ca:5d:56:03\n+--[ RSA 2048]----+\n|          . .E   |\n|         . .  o  |\n|          o    +.|\n|         +   . .*|\n|        S    .oo=|\n|           . oB+.|\n|            oo.+o|\n|              ...|\n|              .o.|\n+-----------------+\n\nubuntu@localhost's password:\n# lsb_release -a\nNo LSB modules are available.\nDistributor ID:\tUbuntu\nDescription:\tUbuntu 14.04.3 LTS\nRelease:\t14.04\nCodename:\ttrusty\n# ^D\n```\n\n## Install\n\nInstall latest version using Golang (recommended)\n\n```console\n$ go get github.com/moul/ssh2docker/cmd/ssh2docker\n```\n\n---\n\nInstall latest version using Homebrew (Mac OS X)\n\n```console\n$ brew install https://raw.githubusercontent.com/moul/ssh2docker/master/contrib/homebrew/assh.rb --HEAD\n\n```\n\nor the latest released version\n\n```console\n$ brew install https://raw.githubusercontent.com/moul/ssh2docker/master/contrib/homebrew/assh.rb\n\n```\n\n## Test with Docker\n\nYou can test **ssh2docker** within Docker, but you will have some limitations, i.e: cannot run with boot2docker.\n\nHere is an example about how to use ssh2docker inside Docker\n\n```console\n$ docker run --privileged -v /var/lib/docker:/var/lib/docker -it --rm -p 2222:2222 moul/ssh2docker\n```\n\n## Changelog\n\n### master (unreleased)\n\n* Support of `docker-exec-args` in hook scripts and in CLI args\n* Sending environment variables to auth scripts\n* TTY is now dynamic ([@quentinperez](https://github.com/quentinperez))\n* Support of exec commands without tty, i.e: git-server, rsync, tftp, ...\n* Support of API hooks for password and public key authentication ([#80](https://github.com/moul/ssh2docker/issues/80))\n* Support of exec requests ([#51](https://github.com/moul/ssh2docker/issues/51))\n* Support of `docker-run-args` in hook scripts ([#30](https://github.com/moul/ssh2docker/issues/30))\n* Support of `--syslog-server` + refactored logs ([#71](https://github.com/moul/ssh2docker/issues/71))\n* Do not ask for a password if only `--publickey-auth-script` is present ([#72](https://github.com/moul/ssh2docker/issues/72))\n* Code refactor (split in modules), update examples, bump dependencies\n* Support of `--syslog-server=unix:///dev/log` ([#74](https://github.com/moul/ssh2docker/issues/74))\n\n[full commits list](https://github.com/moul/ssh2docker/compare/v1.2.0...master)\n\n### [v1.2.0](https://github.com/moul/ssh2docker/releases/tag/v1.2.0) (2015-11-22)\n\n* Support of `--host-key=system` to use OpenSSH keys ([#45](https://github.com/moul/ssh2docker/issues/45))\n* Support of custom entrypoint ([#63](https://github.com/moul/ssh2docker/issues/63))\n* Support of public-key authentication ([#2](https://github.com/moul/ssh2docker/issues/2))\n* Handling custom environment variables, user and command in password script ([#57](https://github.com/moul/ssh2docker/issues/57))\n* Replacing \"_\" by \"/\" on default image name to handle ControlMaster on clients\n* Support of `--banner` option ([#26](https://github.com/moul/ssh2docker/issues/26))\n* Add a not-yet-implemented warning for exec ([#51](https://github.com/moul/ssh2docker/issues/51))\n* Support of `--local-user` option, to allow a specific user to be a local shell ([#44](https://github.com/moul/ssh2docker/issues/44))\n* Kill connection when exiting shell (ctrl+D) ([#43](https://github.com/moul/ssh2docker/issues/43))\n\n[full commits list](https://github.com/moul/ssh2docker/compare/v1.1.0...v1.2.0)\n\n### [v1.1.0](https://github.com/moul/ssh2docker/releases/tag/v1.1.0) (2015-10-07)\n\n* Fix runtime error on Linux ([#38](https://github.com/moul/ssh2docker/issues/38))\n* Initial version of the native Scaleway support ([#36](https://github.com/moul/ssh2docker/issues/36))\n* Support of 'ssh2docker --password-auth-script' options ([#28](https://github.com/moul/ssh2docker/issues/28))\n* Add docker support ([#17](https://github.com/moul/ssh2docker/issues/17))\n* Add GOXC support to build binaries for multiple architectures ([#18](https://github.com/moul/ssh2docker/issues/18))\n* Support of 'ssh2docker --clean-on-startup' ([#23](https://github.com/moul/ssh2docker/issues/23))\n* Add homebrew support ([#16](https://github.com/moul/ssh2docker/issues/16))\n* Add Changelog ([#19](https://github.com/moul/ssh2docker/issues/19))\n\n[full commits list](https://github.com/moul/ssh2docker/compare/v1.0.1...v1.1.0)\n\n### [v1.0.1](https://github.com/moul/ssh2docker/releases/tag/v1.0.1) (2015-09-27)\n\n* Using [party](https://github.com/mjibson/party) to manage dependencies\n\n[full commits list](https://github.com/moul/ssh2docker/compare/v1.0.0...v1.0.1)\n\n### [v1.0.0](https://github.com/moul/ssh2docker/releases/tag/v1.0.0) (2015-09-27)\n\n**Initial release**\n\n#### Features\n\n* Basic logging\n* Handling environment-variable requests\n* Support of `--allowed-images` option ([#4](https://github.com/moul/ssh2docker/issues/4))\n* Ability to configure `docker run` arguments ([#13](https://github.com/moul/ssh2docker/issues/13))\n* Reconnecting to existing containers ([#14](https://github.com/moul/ssh2docker/issues/14))\n* Support of `--no-join` option ([#6](https://github.com/moul/ssh2docker/issues/6))\n\n[full commits list](https://github.com/moul/ssh2docker/compare/a398db225cefe1d1de642217be1c06d6c5d721b0...v1.0.0)\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/moul","https://patreon.com/moul","https://opencollective.com/moul","https://manfred.life/donate"],"categories":["Go","Apps","docker"],"sub_categories":["Servers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoul%2Fssh2docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoul%2Fssh2docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoul%2Fssh2docker/lists"}