mirror of
https://github.com/technorabilia/docker-bits
synced 2024-11-18 15:25:41 +00:00
48 lines
2.4 KiB
YAML
48 lines
2.4 KiB
YAML
# [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.
|
|
|
|
---
|
|
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 UserID
|
|
- PUID=${PUID:-1024}
|
|
# for GroupID
|
|
- PGID=${PGID:-100}
|
|
# Specify a timezone to use for example Europe/Amsterdam
|
|
- TZ=${TZ:-Europe/Amsterdam}
|
|
# 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
|
|
# Optionally specify a URL containing the public key.
|
|
- PUBLIC_KEY_URL=https://github.com/username.keys # optional
|
|
# 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
|