Public | Automated Build

Last pushed: 3 months ago
Short Description
SSH Test Server
Full Description

centos image

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.

Usage

Default

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
this: <user_id>.

Example:

/var/ssh/authorized_keys/root

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 scripts-directory.

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 /var/lib/scripts.

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
Docker Pull Command
Owner
feduxorg
Source Repository