No Description

Fabian Peter Hammerle e4c6cd4cd0 added makefile to facilitate building, tagging & pushing container images 2 years ago
.github 453ec729fa configure dependabot to keep github-actions up-to-date 2 years ago
CHANGELOG.md 26257ec934 release v0.1.1 2 years ago
Dockerfile bbf9217235 upgrade alpine base image from v3.13.5 to v3.14.0 including openssh-server package upgrade from v8.4_p1-r3 to v8.6_p1-r1 (see links below) 2 years ago
Makefile e4c6cd4cd0 added makefile to facilitate building, tagging & pushing container images 2 years ago
README.md 93febe8d67 readme samples: consistently use port 2222 4 years ago
docker-compose.yml 86dbe52ebe docker-compose: mount user config including authorized_keys 4 years ago
entrypoint.sh 245f093c25 replace `passwd -u` to avoid empty passwords 4 years ago
openssh-package-log.url a36338c425 upgrade alpine base image v3.13.2->3.13.3 including openssh-server package upgrade v8.4_p1-r2->v8.4_p1-r3 (diff links below, CVE-2020-14145 only relevant for clients) 3 years ago
openssh-release-notes.url a36338c425 upgrade alpine base image v3.13.2->3.13.3 including openssh-server package upgrade v8.4_p1-r2->v8.4_p1-r3 (diff links below, CVE-2020-14145 only relevant for clients) 3 years ago
sshd_config becd50df02 allow tcp forwarding; disable shell access; remove rsync 4 years ago

README.md

Docker: OpenSSH-Server Restricted to TCP Forwarding 🐳

Docker Hub: https://hub.docker.com/r/fphammerle/ssh-bastion

Example: Share Web Server

bastion $ docker run --name ssh-bastion -p 2222:22 -e USERS=alice,bob fphammerle/ssh-bastion
bastion $ docker cp alice-keys ssh-bastion:/home/alice/.ssh/authorized_keys
bastion $ docker cp bob-keys ssh-bastion:/home/bob/.ssh/authorized_keys
alice $ ssh -N -R 28080:localhost:8080 -p 2222 bastion
bob $ ssh -N -L 8081:localhost:28080 -p 2222 bastion
bob $ curl http://localhost:8081/hello_bob.html

Example: SSH Jump Host

$ docker run --name ssh-bastion \
    --publish 2222:22 --env USERS=alice,bob \
    --volume bastion-host-keys:/etc/ssh/host_keys \
    --volume alice-ssh-config:/home/alice/.ssh:ro \
    --volume bob-ssh-config:/home/bob/.ssh:ro \
    --init --rm \
    fphammerle/ssh-bastion
$ ssh -N -R 22221:localhost:22 -p 2222 alice@bastion
$ ssh -J bob@bastion:2222 -p 22221 localhost

Docker Compose 🐙

  1. git clone https://github.com/fphammerle/docker-ssh-bastion
  2. Adapt $USERS and volumes in docker-compose.yml
  3. docker-compose up