Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pschmitt/docker-sshd
Docker container for openssh-server + STFP. Root allowed.
https://github.com/pschmitt/docker-sshd
docker kubernetes ssh sshd sshfs
Last synced: about 2 months ago
JSON representation
Docker container for openssh-server + STFP. Root allowed.
- Host: GitHub
- URL: https://github.com/pschmitt/docker-sshd
- Owner: pschmitt
- License: gpl-3.0
- Created: 2020-10-14T16:44:21.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-04T15:52:09.000Z (3 months ago)
- Last Synced: 2024-10-13T02:09:57.873Z (3 months ago)
- Topics: docker, kubernetes, ssh, sshd, sshfs
- Language: Shell
- Homepage: https://hub.docker.com/r/pschmitt/sshd
- Size: 104 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker service for SSHD
[![Build](https://github.com/pschmitt/docker-sshd/workflows/Build/badge.svg)](https://github.com/pschmitt/docker-sshd/actions?query=workflow%3ABuild)
[![Docker](https://img.shields.io/docker/pulls/pschmitt/sshd)](https://hub.docker.com/u/pschmitt/sshd)## Thanks
This is loosely based on, or rather inspired by [linuxserver/ssh-server](https://github.com/linuxserver/docker-openssh-server).
## What's the point?
The main difference is that running as root is allowed, for SSHFS among others.
Also you can set the port the SSH daemon listens on **inside the container**,
which may come in handy if you use this container as a way to debug a pod
running on the host network namespace (if you blindly listen on `22/tcp` you
may end up competing with the host's SSH service - which you probably don't
want to, ever.).## Usage
```shell
docker run -ti --rm \
-v "$PWD/config:/config" \
-p "22222:22222/tcp" \
-e SSHD_PORT="22222" \
-e AUTHORIZED_KEYS="ssh-ed25519 XXX" \
-e GITHUB_USERNAME="pschmitt" \
-e USERNAME="user01" \
-e PASSWORD="somethingImpossibleToRemember" \
-e PERMIT_ROOT_LOGIN="no" \
-e PUID="1000" \
-e PGID="1000" \
pschmitt/sshd
```Then, to connect using the example above - from the same machine:
```shell
ssh -p 22222 user01@localhost
```## Advanced usage
If you need to set the DNS ndots value (which you may since this container is
based on Alpine) you can so using the `DNS_NDOTS` env var.Example:
```shell
docker run -ti --rm \
-p "22222:22222/tcp" \
-e SSHD_PORT="22222" \
-e USERNAME="user01" \
-e PASSWORD="somethingImpossibleToRemember" \
-e DNS_NDOTS="1" \
pschmitt/sshd
```