Add an sshd container

This is mainly for testing.

You can run with something like
```
docker run -v ~/.ssh/id_rsa.pub:/root/.ssh/authorized_keys -p 2222:22 -e TINI_SUBREAPER=1 --pid=host mobylinux/sshd:36c44542d8120e384c724a078e3e489f7a58382c
```

if you want to run in the host pid namespace. You must provide an
authorized key, you may provide a host key.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack
2017-01-25 15:37:19 +00:00
parent 537ad4e34d
commit 67833e272f
5 changed files with 194 additions and 0 deletions

6
base/sshd/usr/bin/ssh.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/sh
KEYS=$(find /etc/ssh -name 'ssh_host_*_key')
[ -z "$KEYS" ] && ssh-keygen -A >/dev/null 2>/dev/null
exec /usr/sbin/sshd -D