From 7fbd58f476b23187602015c027c92193ecf588ae Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Fri, 22 May 2015 16:30:50 -0700 Subject: [PATCH] Add debug-user element This adds an element that can be used to set up a separate user for in the appliance for debugging purposes. Change-Id: I46777b785f8575acdc50ee19c059b08b89bfed98 --- .../elements/debug-user/README.md | 10 +++++++++ .../debug-user/install.d/50-debug-user | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 diskimage-builder/elements/debug-user/README.md create mode 100755 diskimage-builder/elements/debug-user/install.d/50-debug-user 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 <