Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 1.1 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.1 KB

docker-sshd

A lightweight OpenSSH Docker image built atop Alpine Linux.

Basic Usage

$ docker run --rm --publish=1080:22 asensei/docker-sshd # /entrypoint.sh
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.

$ ssh username@localhost -p 1080
...

Arguments are passed to sshd. For example, to enable debug output:

$ docker run --rm --publish=1080:22 asensei/docker-sshd -o LogLevel=DEBUG
...

Use authorized keys

Mount the authorized_keys (read-only), then specify the destination path in AUTHORIZED_KEYS. When the container starts, it makes a writable copy of the authorized_keys and it ensures that permissions on the file itself are correct.

docker run \
  -e AUTHORIZED_KEYS='/root/my_keys'
  -v /Users/john/auth_keys:/root/my_keys:ro
  -p 1080:22
  asensei/docker-sshd