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
- Host: GitHub
- URL: https://github.com/mediacomem/docker-openssh-host-keys
- Owner: MediaComem
- License: mit
- Created: 2020-04-23T16:31:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T08:42:33.000Z (about 6 years ago)
- Last Synced: 2025-10-20T20:14:37.107Z (8 months ago)
- Topics: docker, openssh, ssh-keygen
- Language: Shell
- Homepage: https://hub.docker.com/r/mediacomem/openssh-host-keys
- Size: 4.88 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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.