From 2c5f667acb335b382cd9c01e43e78f9aff3a7358 Mon Sep 17 00:00:00 2001 From: Jake Buchholz Date: Tue, 14 Aug 2018 15:37:50 -0700 Subject: * disable root/alpine passwords instead of scrambling them * state as a dependency --- README.md | 1 + tiny-ec2-bootstrap | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d4fc869..ae6ad63 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ built-in. The only required dependencies are: - bash-like shell (e.g. bash, dash, ash) - wget +- resize2fs ## Supported Features and Environments diff --git a/tiny-ec2-bootstrap b/tiny-ec2-bootstrap index 84f7af2..c03fcd3 100644 --- a/tiny-ec2-bootstrap +++ b/tiny-ec2-bootstrap @@ -56,8 +56,8 @@ _resize_root_partition() { resize2fs $(mountpoint -n / | cut -d' ' -f1) } -_scramble_password() { - echo "$1:$(head -c 100 /dev/urandom | sha512sum | cut -d' ' -f1)" | chpasswd +_disable_password() { + echo "$1:*" | chpasswd -e } start() { @@ -66,8 +66,8 @@ start() { [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud - ebegin "Scrambling root password"; _scramble_password root; eend $? - ebegin "Scrambling alpine password"; _scramble_password alpine; eend $? + ebegin "Disabling root password"; _disable_password root; eend $? + ebegin "Disabling alpine password"; _disable_password alpine; eend $? ebegin "Resizing root partition"; _resize_root_partition; eend $? ebegin "Setting ec2 hostname"; _update_hostname; eend $? ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? -- cgit v1.2.3 From eaef72fef992e008b854f6a50d40f37c19688fb5 Mon Sep 17 00:00:00 2001 From: Jake Buchholz Date: Tue, 14 Aug 2018 15:40:32 -0700 Subject: scramble --> disable passwords --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ae6ad63..1e6e655 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ those things. Instead it supports: - setting system hostname - install user's configured SSH keys to the alpine user's authorized_keys file - run any script-like user data (must start with #!) -- scramble root and alpine password +- disable root and alpine password - resize root partition to available disk space These steps only run once. After the initial bootstrap the bootstrapper script -- cgit v1.2.3