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 May 25, 2024
1 parent a8b2f4d commit ed3217b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 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,11 @@
#!/bin/sh
# Remove the user embedded in the image,
# and use cloud-init for users and groups.
test -f /etc/alpine-release || 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 ed3217b

Please sign in to comment.