An open API service indexing awesome lists of open source software.

https://github.com/mediacomem/docker-openssh-host-keys

Generate SSH host keys in a Docker container and copy them to a mounted directory
https://github.com/mediacomem/docker-openssh-host-keys

docker openssh ssh-keygen

Last synced: about 1 month ago
JSON representation

Generate SSH host keys in a Docker container and copy them to a mounted directory

Awesome Lists containing this project

README

          

# Docker OpenSSH Host Keys

Generates SSH host keys in a Docker container and copies them to a mounted
directory.

- [Usage](#usage)
- [Configuration](#configuration)

## Usage

This command will generate and copy a set of SSH host keys to the
`/path/to/target` directory:

```bash
docker run \
--rm \
-e SSH_HOST_KEYS_OWNER=root \
-e SSH_HOST_KEYS_GROUP=root \
-e SSH_HOST_KEYS_MODE=644 \
-e SSH_HOST_KEYS_DIRECTORY_MODE=700 \
-v /path/to/target:/target \
mediacomem/openssh-host-keys
```

## Configuration

The generated SSH host keys can be customized through these environment
variables. All variables are optional.

Variable | Default value | Description
:----------------------------- | :------------ | :-------------------------------------------------------------------------
`SSH_HOST_KEYS_OWNER` | `root` | User or UID who will own the generated SSH host keys.
`SSH_HOST_KEYS_GROUP` | `root` | Group or GID that will own the generated SSH host keys.
`SSH_HOST_KEYS_MODE` | `644` | File system permissions of the generated SSH host keys.
`SSH_HOST_KEYS_DIRECTORY_MODE` | - | Optional file system permissions that will be set on the target directory.