This "docker" image is based on "feduxorg/centos". It has "OpenSSH" installed.
It only supports a key-based authentication and does not make dns reverse
lookups for clients. It's primary use is for testing purposes.
To run a image please use this command:
docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /var/log/journal:/var/log/journal feduxorg/centos-ssh
Mount ssh keys
To make it easier for you to use this image for testing, mount a directory to
/var/ssh/authorized_keys. Each file in this directory needs to be named like
To run the image, you can use the following command:
docker run -it --rm --name centos1 -v /sys/fs/cgroup:/sys/fs/cgroup -v $(pwd)/ssh:/var/ssh/authorized_keys feduxorg/centos
Create new user on startup
First create a
mkdir -p scripts
Then place an executable file
init.sh - the file name can be arbitrary chosen
- in the
scripts-directory with the following content:
#!/usr/bin/env bash useradd -m user1
And make sure, it's executable.
# chmod +x <file> chmod +x init.sh
Please mount a directory of your choice to
docker run -it --rm --name centos1 -v /sys/fs/cgroup:/sys/fs/cgroup -v $(pwd)/ssh:/var/ssh/authorized_keys -v $(pwd)/scripts:/var/lib/scripts feduxorg/centos