677
This is used as a dummy SSH server in some of our integration tests.
This is a lightweight SSH server in a docker container.
This image provides:
Mount contents of ./ssh-data folder into sftp server inside container.
version: '2'
services:
# SSHD Server
sshtest:
image: checkoutfinland/dummy-sftp-server
environment:
# (mandatory) Username for the login
USERNAME: sftp
# (optional) Use dummy ssh key you generated for this test
PUBLIC_KEY: ssh-rsa AAAA....
# (optional) Use custom path for AuthorizedKeysFile
PUBLIC_KEYS_PATH: /etc/ssh/authorized_keys
# (optional) Use the path of mapped volume, default: /in
FOLDER: /in
# (optional) put the $FOLDER inside chroot, default: 1
CHROOT: 1
# (optional) use custom port number, default: 22
PORT: 2238
cap_add:
# Required if you want to chroot
- SYS_ADMIN
security_opt:
# Required if you want to chroot
- apparmor:unconfined
ports:
- 2238:2238
volumes:
./ssh-data:/in
Verify that it works by opening SSH shell to the docker container:
$ ssh -p 2238 ubuntu@localhost echo "Hello World!"
Hello World!
Configuration is done through environment variables.
Required:
Optional:
If you want to run the SSH server with chroot feature, the docker image has to be run with additional capabilities.
cap_add:
- SYS_ADMIN
security_opt:
- apparmor:unconfined
This is due to the use of mount --bind in the init script.
If someone has a better way to do, feel free to submit a pull request or a hint.
This software is under MIT license.
Content type
Image
Digest
Size
65.1 MB
Last updated
about 6 years ago
docker pull javanile/fake-ssh-server