1
0
Go to file
Pim van den Berg 2a2ea80961
Some checks reported errors
continuous-integration/drone/push Build was killed
mtu
2022-09-18 15:30:32 +02:00
.drone.yml mtu 2022-09-18 15:30:32 +02:00
build.sh fix(Dockerfile): fail build when apt-get fails 2022-09-17 15:00:56 +02:00
Dockerfile feat: install sudoers + allow sudo access for created users 2022-09-18 14:50:54 +02:00
README.md feat: support configuring a shell for a user 2022-09-17 15:01:11 +02:00
rebuild.sh fix(rebuild): shellcheck warnings 2022-09-15 14:49:13 +02:00
setup.sh feat: install sudoers + allow sudo access for created users 2022-09-18 14:50:54 +02:00
start.sh feat: split setup to setup.sh and only run once 2022-09-18 14:32:32 +02:00

Jumpbox Docker container

  • Debian slim based image
  • OpenSSH server
  • User/group creation on startup

Supported tags and respective Dockerfile links

Usage

Environment variables

Key Format Description
ROOT_AUTHORIZED_KEYS /path/to/file Path to file that contains the public SSH keys that can be used for root user authentication. This file will be copied to /root/.ssh/authorized_keys
HOSTKEYS /path/to/hostkey;... Specifies a (semi-colon separated list of) file(s) containing a private host key used by SSH.
USERADD {username}:{uid}:{gid}:{shell};... Create user account(s) on startup
GROUPADD {groupname}:{gid};... Create group account(s) on startup
BASE_DIR /home Basedir used for user account creation (Default: /home)

docker run

$ docker run -it \
    --name jumpbox \
    -v $(pwd)/jumpbox:/var/lib/jumpbox \
    -e "ROOT_AUTHORIZED_KEYS=/var/lib/jumpbox/authorized_keys"
    -e "HOSTKEYS=/var/lib/jumpbox/ssh_host_ed25519_key;/var/lib/jumpbox/ssh_host_rsa_key"
    -e "USERADD=jumpbox:1000:1000:/bin/bash"
    -e "GROUPADD=jumpbox:1000"
    -p 1022:22 \
    pommib/jumpbox:latest

docker-compose

version: "3"

services:
  jumpbox:
    container_name: jumpbox
    image: pommib/jumpbox:latest
    ports:
      - "1022:22/tcp"
    volumes:
      - '${PWD}/jumpbox:/var/lib/jumpbox'
    environment:
      ROOT_AUTHORIZED_KEYS: /var/lib/jumpbox/authorized_keys
      HOSTKEYS: /var/lib/jumpbox/ssh_host_ed25519_key;/var/lib/jumpbox/ssh_host_rsa_key
      USERADD: jumpbox:1000:1000:/bin/bash
      GROUPADD: jumpbox:1000