You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
livecd-rootfs/live-build/ubuntu-core/hooks/01-setup_user.chroot

25 lines
587 B

#!/bin/sh -x
set -e
# There is no default user anymore, console-conf is responsible
# for creating one
# setup the required files for extrausers
for name in group gshadow passwd shadow subuid subgid; do
touch /var/lib/extrausers/$name
done
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