diff --git a/diskimage-builder/elements/debug-user/README.md b/diskimage-builder/elements/debug-user/README.md new file mode 100644 index 0000000..eafa188 --- /dev/null +++ b/diskimage-builder/elements/debug-user/README.md @@ -0,0 +1,10 @@ + +Creates a sudo privileged user in the appliance VM that can be used for +debugging connectivity issues via the console, when SSH connectivity is +not possible. Note that an 'akanda' user is created by the RUG and setup +to authenticate using a SSH public key. This element should only be included +when building images for develoment environments. + +The username and password can be set in the build environment as +$DIB_AKANDA_APPLIANCE_DEBUG_USER and $DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD +The defaults are akanda-debug/akanda. diff --git a/diskimage-builder/elements/debug-user/install.d/50-debug-user b/diskimage-builder/elements/debug-user/install.d/50-debug-user new file mode 100755 index 0000000..8d58365 --- /dev/null +++ b/diskimage-builder/elements/debug-user/install.d/50-debug-user @@ -0,0 +1,21 @@ +#!/bin/bash + +DIB_AKANDA_APPLIANCE_DEBUG_USER=${DIB_AKANDA_APPLIANCE_DEBUG_USER:-akanda-debug} +DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD=${DIB_AKANDA_APPLIANCE_DEBUG_PASSWORD:-akanda} + +set -eu +set -o xtrace + +useradd -m $DIB_AKANDA_APPLIANCE_DEBUG_USER -s /bin/bash + +passwd $DIB_AKANDA_APPLIANCE_DEBUG_USER < /etc/sudoers.d/akanda-debug-user <