Skip to content

Commit

Permalink
Remove the embedded default user in alpine cloud
Browse files Browse the repository at this point in the history
There should not be a non-system user in the image.

Let cloud-init handle the users and groups instead.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
  • Loading branch information
afbjorklund committed Jul 16, 2024
1 parent aaf8b9c commit 7b08d5b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cidata/cidata.TEMPLATE.d/boot/00-alpine-user-group.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh
# Remove the user embedded in the image,
# and use cloud-init for users and groups.
test -f /etc/alpine-release || exit 0
test "$LIMA_CIDATA_USER" != "alpine" || exit 0

if [ "$(id -u alpine 2>&1)" = "1000" ]; then
userdel alpine
rmdir /home/alpine
cloud-init clean --logs
reboot
fi

0 comments on commit 7b08d5b

Please sign in to comment.