From 5af01cc90945eb929ad3443337a7627deb8a48d0 Mon Sep 17 00:00:00 2001 From: Garrett Mills Date: Sat, 26 Sep 2026 14:17:38 -0500 Subject: [PATCH] jump box - add target user to sudoers and handling for on-boot script --- jump-box/startup.bash | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/jump-box/startup.bash b/jump-box/startup.bash index 1ea7ffb..19b3c8a 100644 --- a/jump-box/startup.bash +++ b/jump-box/startup.bash @@ -21,6 +21,17 @@ chown "$TARGET_USER":"$TARGET_USER" /var/log/container-stdout.log # This only really matters for the first-run: chown "$TARGET_USER":"$TARGET_USER" "/home/$TARGET_USER" +# Make the target user a sudoer: +echo "$TARGET_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/target-user +chmod 440 /etc/sudoers.d/target-user +visudo -cf /etc/sudoers.d/target-user + +# If the target user has an on-boot script defined, run it: +if [ -f "/home/$TARGET_USER/.on-boot.sh" ]; then + echo "Running on-boot script..." + sudo -u "$TARGET_USER" "/home/$TARGET_USER/.on-boot.sh" +fi + echo "Ready." tail -f /var/log/container-stdout.log &