Keine Beschreibung

Fabian Peter Hammerle c74b66a9b5 upgrade openssh-server package from v9.5_p1-r0 to v9.6_p1-r0 vor 11 Monaten
.github b6586e5694 build(deps): bump docker/build-push-action from 5.0.0 to 5.1.0 (#69) vor 1 Jahr
CHANGELOG.md e40e029114 sshd: no longer accept RSA keys < 2048 bits for authentication vor 2 Jahren
Dockerfile c74b66a9b5 upgrade openssh-server package from v9.5_p1-r0 to v9.6_p1-r0 vor 11 Monaten
Makefile e4c6cd4cd0 added makefile to facilitate building, tagging & pushing container images vor 3 Jahren
README.md 93febe8d67 readme samples: consistently use port 2222 vor 5 Jahren
docker-compose.yml 86dbe52ebe docker-compose: mount user config including authorized_keys vor 5 Jahren
entrypoint.sh 245f093c25 replace `passwd -u` to avoid empty passwords vor 5 Jahren
sshd_config e40e029114 sshd: no longer accept RSA keys < 2048 bits for authentication vor 2 Jahren

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