:whale: standalone SSH server that connects you to your Docker containers
:whale: standalone SSH server that connects you to your Docker containers
:wrench: SSH server that can create new Docker containers and/or join existing ones, with session, and dynamic configuration support
SSH chroot with steroids
……Server
$ ssh2docker
INFO[0000] Listening on port 2222
INFO[0001] NewClient (0): User="alpine", ClientVersion="5353482d322e302d4f70656e5353485f362e362e317031205562756e74752d327562756e747532"
INFO[0748] NewClient (1): User="ubuntu", ClientVersion="5353482d322e302d4f70656e5353485f362e362e317031205562756e74752d327562756e747532"Client
$ ssh localhost -p 2222 -l alpine
Host key fingerprint is 59:46:d7:cf:ca:33:be:1f:58:fd:46:c8:ca:5d:56:03
+--[ RSA 2048]----+
| . .E |
| . . o |
| o +.|
| + . .*|
| S .oo=|
| . oB+.|
| oo.+o|
| ...|
| .o.|
+-----------------+
alpine@localhost's password:
/ # cat /etc/alpine-release
3.2.0
/ # ^D$ ssh localhost -p 2222 -l ubuntu
Host key fingerprint is 59:46:d7:cf:ca:33:be:1f:58:fd:46:c8:ca:5d:56:03
+--[ RSA 2048]----+
| . .E |
| . . o |
| o +.|
| + . .*|
| S .oo=|
| . oB+.|
| oo.+o|
| ...|
| .o.|
+-----------------+
ubuntu@localhost's password:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty
# ^DInstall latest version using Golang (recommended)
$ go get github.com/moul/ssh2docker/cmd/ssh2dockerInstall latest version using Homebrew (Mac OS X)
$ brew install https://raw.githubusercontent.com/moul/ssh2docker/master/contrib/homebrew/assh.rb --HEAD
or the latest released version
$ brew install https://raw.githubusercontent.com/moul/ssh2docker/master/contrib/homebrew/assh.rb
You can test ssh2docker within Docker, but you will have some limitations, i.e: cannot run with boot2docker.
Here is an example about how to use ssh2docker inside Docker
$ docker run --privileged -v /var/lib/docker:/var/lib/docker -it --rm -p 2222:2222 moul/ssh2dockerdocker-exec-args in hook scripts and in CLI argsdocker-run-args in hook scripts (#30)--syslog-server + refactored logs (#71)--publickey-auth-script is present (#72)--syslog-server=unix:///dev/log (#74)--host-key=system to use OpenSSH keys (#45)--banner option (#26)--local-user option, to allow a specific user to be a local shell (#44)Initial release
--allowed-images option (#4)docker run arguments (#13)--no-join option (#6)MIT
No open issues yet, or sync has not completed.