1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-15 11:22:43 +03:00

only lock root, not EC2_USER

This commit is contained in:
Jake Buchholz 2021-01-08 19:36:14 -08:00
parent a866c27e06
commit e54b913fa4

View File

@ -85,8 +85,12 @@ _resize_root_partition() {
resize2fs "$mountpoint" resize2fs "$mountpoint"
} }
_lock_root_user() {
passwd -l root
}
_disable_password() { _disable_password() {
passwd -l "$1" echo "$1:*" | chpasswd -e
} }
start() { start() {
@ -95,7 +99,7 @@ start() {
[ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud [ -d "/var/lib/cloud" ] || mkdir -p /var/lib/cloud
ebegin "Disabling root password"; _disable_password root; eend $? ebegin "Locking root account"; _lock_root_account; eend $?
ebegin "Disabling $EC2_USER password"; _disable_password "$EC2_USER"; eend $? ebegin "Disabling $EC2_USER password"; _disable_password "$EC2_USER"; eend $?
ebegin "Expanding root partition"; _resize_root_partition; eend $? ebegin "Expanding root partition"; _resize_root_partition; eend $?
ebegin "Setting ec2 hostname"; _update_hostname; eend $? ebegin "Setting ec2 hostname"; _update_hostname; eend $?