summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorDaniel F. Dickinson <cshored@danielfdickinson.ca>2020-09-08 16:16:07 -0400
committerGitHub <noreply@github.com>2020-09-08 21:16:07 +0100
commitc1a7dae113ce943abe8bf5d5ab36fb7aac829fd2 (patch)
tree117a02dea1db96a327456dd1cc7b3f974c345b57 /build.sh
parentd6207a620a10ba0ec25f95a637d3fdd272b47e84 (diff)
Enable adding SSH pubkey and setting pubkey only (#380)
This commit add the ability to specify an SSH public key as well as the option to disable password authentication and only allow public key authentication for SSH. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index a8247ab..6f720b1 100755
--- a/build.sh
+++ b/build.sh
@@ -171,6 +171,7 @@ export WPA_ESSID
export WPA_PASSWORD
export WPA_COUNTRY
export ENABLE_SSH="${ENABLE_SSH:-0}"
+export PUBKEY_ONLY_SSH="${PUBKEY_ONLY_SSH:-0}"
export LOCALE_DEFAULT="${LOCALE_DEFAULT:-en_GB.UTF-8}"
@@ -181,6 +182,8 @@ export TIMEZONE_DEFAULT="${TIMEZONE_DEFAULT:-Europe/London}"
export GIT_HASH=${GIT_HASH:-"$(git rev-parse HEAD)"}
+export PUBKEY_SSH_FIRST_USER
+
export CLEAN
export IMG_NAME
export APT_PROXY
@@ -226,6 +229,11 @@ if [[ -n "${WPA_PASSWORD}" && ${#WPA_PASSWORD} -lt 8 || ${#WPA_PASSWORD} -gt 63
exit 1
fi
+if [[ "${PUBKEY_ONLY_SSH}" = "1" && -z "${PUBKEY_SSH_FIRST_USER}" ]]; then
+ echo "Must set 'PUBKEY_SSH_FIRST_USER' to a valid SSH public key if using PUBKEY_ONLY_SSH"
+ exit 1
+fi
+
mkdir -p "${WORK_DIR}"
log "Begin ${BASE_DIR}"