From 5f9521d65f10a9af8ac3e00ef507c431fc5a7998 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 2 Sep 2016 17:04:23 +0200 Subject: [PATCH] do not create "ubuntu" user for ubuntu-core anymore, the console-conf package will create this user now --- debian/changelog | 7 ++++ .../ubuntu-core/hooks/01-setup_user.chroot | 39 +++++-------------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/debian/changelog b/debian/changelog index babe3473..0daf34be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +livecd-rootfs (2.430) UNRELEASED; urgency=medium + + * do not create "ubuntu" user for ubuntu-core anymore, the + console-conf package will create this user now + + -- Michael Vogt Fri, 02 Sep 2016 17:03:57 +0200 + livecd-rootfs (2.429) yakkety; urgency=medium * live-build/auto/build: Fix typo in netplan policy snippet. diff --git a/live-build/ubuntu-core/hooks/01-setup_user.chroot b/live-build/ubuntu-core/hooks/01-setup_user.chroot index bc470c09..fe856e6b 100755 --- a/live-build/ubuntu-core/hooks/01-setup_user.chroot +++ b/live-build/ubuntu-core/hooks/01-setup_user.chroot @@ -2,42 +2,23 @@ set -e -USER=ubuntu -UGID=1000 +# There is no default user anymore, console-conf is responsible +# for creating one -echo "I: creating default user $USER" -adduser --gecos $USER --disabled-login $USER --uid $UGID - -for extragroup in adm sudo; do - adduser $USER $extragroup +# setup the required files for extrausers +for name in group gshadow passwd shadow subuid subgid; do + touch /var/lib/extrausers/$name done -chown -R $UGID:$UGID /home/$USER +for name in gshadow shadow; do + chmod 640 /var/lib/extrausers/$name + chown root:shadow /var/lib/extrausers/$name +done # Enable libnss-extrusers sed -i 's/^group:.*compat/\0 extrausers/' /etc/nsswitch.conf sed -i 's/^passwd:.*compat/\0 extrausers/' /etc/nsswitch.conf sed -i 's/^shadow:.*compat/\0 extrausers/' /etc/nsswitch.conf -# Move user from /etc to extrausers location -grep "^$USER" /etc/group >> /var/lib/extrausers/group -grep "^$USER" /etc/passwd >> /var/lib/extrausers/passwd -grep "^$USER" /etc/shadow >> /var/lib/extrausers/shadow -grep "^$USER" /etc/gshadow >> /var/lib/extrausers/gshadow -chmod 0644 /var/lib/extrausers/group -chmod 0644 /var/lib/extrausers/passwd -chmod 0640 /var/lib/extrausers/shadow -chmod 0640 /var/lib/extrausers/gshadow -chown root:shadow /var/lib/extrausers/shadow -chown root:shadow /var/lib/extrausers/gshadow -sed -i "/^$USER/d" /etc/group -sed -i "/^$USER/d" /etc/passwd -sed -i "/^$USER/d" /etc/shadow -sed -i "/^$USER/d" /etc/gshadow -touch /var/lib/extrausers/subuid -touch /var/lib/extrausers/subgid - -# needs to run *after* the user was moved out to /var/lib/extrausers -echo "I: set user $USER password to $USER" -echo "$USER:$USER" | chpasswd +