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

Merge pull request #21 from mcrute/fix/do-not-lock-EC2_USER

only lock root, not EC2_USER
This commit is contained in:
tomalok 2021-01-08 19:42:24 -08:00 committed by GitHub
commit 60233942e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,8 +85,12 @@ _resize_root_partition() {
resize2fs "$mountpoint"
}
_lock_root_user() {
passwd -l root
}
_disable_password() {
passwd -l "$1"
echo "$1:*" | chpasswd -e
}
start() {
@ -95,7 +99,7 @@ start() {
[ -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 "Expanding root partition"; _resize_root_partition; eend $?
ebegin "Setting ec2 hostname"; _update_hostname; eend $?