Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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.

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
```