docker-bits/lsio/openssh-server/docker-compose.yaml

48 lines
2.4 KiB
YAML
Raw Normal View History

2021-04-21 00:55:42 +00:00
# [Openssh-server](https://www.openssh.com/) is a sandboxed environment that
# allows ssh access without giving keys to the entire server. Giving ssh access
# via private key often means giving full access to the server. This container
# creates a limited and sandboxed environment that others can ssh into. The
# users only have access to the folders mapped and the processes running inside
# this container.
2021-04-10 10:16:29 +00:00
---
version: "2.1"
services:
openssh-server:
image: ghcr.io/linuxserver/openssh-server
container_name: openssh-server
# Optionally the hostname can be defined.
hostname: {{ project_name }} # optional
environment:
# for GroupID
- PUID=${PUID:-1024}
# for UserID
- PGID=${PGID:-100}
# Specify a timezone to use for example Europe/Amsterdam
2021-04-13 00:58:58 +00:00
- TZ=${TZ:-Europe/Amsterdam}
2021-04-10 10:16:29 +00:00
# Optional ssh public key, which will automatically be added to authorized_keys.
- PUBLIC_KEY=yourpublickey # optional
# Optionally specify a file containing the public key (works with docker secrets).
- PUBLIC_KEY_FILE=/path/to/file # optional
# Optionally specify a directory containing the public keys (works with docker secrets).
- PUBLIC_KEY_DIR=/path/to/directory/containing/_only_/pubkeys # optional
2021-11-22 01:06:34 +00:00
# Optionally specify a URL containing the public key.
- PUBLIC_KEY_URL=https://github.com/username.keys # optional
2021-04-10 10:16:29 +00:00
# Set to `true` to allow `linuxserver.io`, the ssh user, sudo access. Without `USER_PASSWORD` set, this will allow passwordless sudo access.
- SUDO_ACCESS=false # optional
# Set to `true` to allow user/password ssh access. You will want to set `USER_PASSWORD` or `USER_PASSWORD_FILE` as well.
- PASSWORD_ACCESS=false # optional
# Optionally set a sudo password for `linuxserver.io`, the ssh user. If this or `USER_PASSWORD_FILE` are not set but `SUDO_ACCESS` is set to true, the user will have passwordless sudo access.
- USER_PASSWORD=password # optional
# Optionally specify a file that contains the password. This setting supersedes the `USER_PASSWORD` option (works with docker secrets).
- USER_PASSWORD_FILE=/path/to/file # optional
# Optionally specify a user name (Default:`linuxserver.io`)
- USER_NAME=linuxserver.io # optional
volumes:
# Contains all relevant configuration files.
- ${BASEDIR:-/volume1/docker}/openssh-server/config:/config
ports:
# ssh port
- 2222:2222
restart: unless-stopped