-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User creation errors, with the new alpine-image template #2362
Comments
Seems like we might need some more packages, beyond "sudo":
The default user in the image is using the Or that might be fixed later, and it is the UID conflict that breaks it:
The other error was from missing
|
/etc/cloud/cloud.cfg
https://gitlab.alpinelinux.org/alpine/cloud/alpine-cloud-images/-/blob/main/scripts/setup It's a bug in alpine cloud, the default user is already added (with a different shell and groups) commit 274d883acb82d900abee9c451e1503777f7d02b7 @@ -174,6 +195,7 @@ configure_system() {
fi
# explicitly lock the root account
+ chroot "$TARGET" /bin/sh -c "/bin/echo 'root:*' | /usr/sbin/chpasswd -e"
chroot "$TARGET" /usr/bin/passwd -l root
# set up image user
@@ -181,7 +203,7 @@ configure_system() {
chroot "$TARGET" /usr/sbin/addgroup "$user"
chroot "$TARGET" /usr/sbin/adduser -h "/home/$user" -s /bin/sh -G "$user" -D "$user"
chroot "$TARGET" /usr/sbin/addgroup "$user" wheel
- chroot "$TARGET" /usr/bin/passwd -u "$user"
+ chroot "$TARGET" /bin/sh -c "echo '$user:*' | /usr/sbin/chpasswd -e"
# modify PS1s in /etc/profile to add user
sed -Ei \ |
There is another hack in the cloud-images, that works around the lock password issue: # cloud-init locks our user by default which means alpine can't login from
# SSH. This seems like a bug in cloud-init that should be fixed but we can
# hack around it for now here.
if [ -f "$TARGET"/etc/cloud/cloud.cfg ]; then
sed -i '/lock_passwd:/s/True/False/' "$TARGET"/etc/cloud/cloud.cfg
fi https://gitlab.alpinelinux.org/alpine/cloud/alpine-cloud-images/-/blob/main/scripts/setup-cloudinit |
Removing the default user is just a hack, it should not be there (in the "cloud-init" variant) |
Description
Getting errors from cloud-config, when trying to create the initial user:
Will try to access the image (no login through serial), to find the log file...
https://www.alpinelinux.org/cloud/
The text was updated successfully, but these errors were encountered: