From 3c1c0ad41f78d819fe48a2723df8d413ff961d13 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sun, 18 Sep 2022 14:38:53 +0200 Subject: [PATCH] feat: install sudoers + allow sudo access for created users --- Dockerfile | 1 + setup.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index efd31b1..0d41f20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ RUN set -eux && \ DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ openssh-server \ + sudo \ locales \ curl \ telnet \ diff --git a/setup.sh b/setup.sh index 8076088..f909624 100755 --- a/setup.sh +++ b/setup.sh @@ -46,6 +46,7 @@ while [ "$USERADD" != "$i" ] ;do USER_SHELL=$j useradd --home-dir "$BASE_DIR/$USER_NAME" --shell "$USER_SHELL" --uid "$USER_UID" --gid "$USER_GID" "$USER_NAME" + echo "$USER_NAME ALL=(ALL) NOPASSWD:ALL" > "/etc/sudoers.d/$USER_NAME" done # HOSTKEYS="/var/lib/jumpbox/ssh_host_ed25519_key;/var/lib/jumpbox/ssh_host_rsa_key"