diff options
author | Jake Buchholz <tomalok@gmail.com> | 2018-08-14 15:37:50 -0700 |
---|---|---|
committer | Jake Buchholz <tomalok@gmail.com> | 2018-08-14 15:37:50 -0700 |
commit | 2c5f667acb335b382cd9c01e43e78f9aff3a7358 (patch) | |
tree | 9c96885c7eaedbc79c6e7eac4b02d80066d0ac96 | |
parent | 95f7fc2b48177a8a673d5e3dbe016c642a465ded (diff) | |
download | tiny-ec2-bootstrap-2c5f667acb335b382cd9c01e43e78f9aff3a7358.tar.bz2 tiny-ec2-bootstrap-2c5f667acb335b382cd9c01e43e78f9aff3a7358.tar.xz tiny-ec2-bootstrap-2c5f667acb335b382cd9c01e43e78f9aff3a7358.zip |
* disable root/alpine passwords instead of scrambling them
* state as a dependency
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | tiny-ec2-bootstrap | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -14,6 +14,7 @@ built-in. The only required dependencies are: | |||
14 | 14 | ||
15 | - bash-like shell (e.g. bash, dash, ash) | 15 | - bash-like shell (e.g. bash, dash, ash) |
16 | - wget | 16 | - wget |
17 | - resize2fs | ||
17 | 18 | ||
18 | ## Supported Features and Environments | 19 | ## Supported Features and Environments |
19 | 20 | ||
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() { | |||
56 | resize2fs $(mountpoint -n / | cut -d' ' -f1) | 56 | resize2fs $(mountpoint -n / | cut -d' ' -f1) |
57 | } | 57 | } |
58 | 58 | ||
59 | _scramble_password() { | 59 | _disable_password() { |
60 | echo "$1:$(head -c 100 /dev/urandom | sha512sum | cut -d' ' -f1)" | chpasswd | 60 | echo "$1:*" | chpasswd -e |
61 | } | 61 | } |
62 | 62 | ||
63 | start() { | 63 | start() { |
@@ -66,8 +66,8 @@ start() { | |||
66 | 66 | ||
67 | [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud | 67 | [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud |
68 | 68 | ||
69 | ebegin "Scrambling root password"; _scramble_password root; eend $? | 69 | ebegin "Disabling root password"; _disable_password root; eend $? |
70 | ebegin "Scrambling alpine password"; _scramble_password alpine; eend $? | 70 | ebegin "Disabling alpine password"; _disable_password alpine; eend $? |
71 | ebegin "Resizing root partition"; _resize_root_partition; eend $? | 71 | ebegin "Resizing root partition"; _resize_root_partition; eend $? |
72 | ebegin "Setting ec2 hostname"; _update_hostname; eend $? | 72 | ebegin "Setting ec2 hostname"; _update_hostname; eend $? |
73 | ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? | 73 | ebegin "Setting ec2 user ssh keys"; _set_ssh_keys "alpine"; eend $? |