mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-13 22:28:27 +00:00
- port static uid/gid setup from ubuntu-touch * live-build/ubuntu-core/hooks/15-pycompile-snappy.chroot: - byte compile .pyc files for snappy
34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/bin/sh -x
|
|
|
|
USER=ubuntu
|
|
UGID=1000
|
|
|
|
echo "I: creating default user $USER"
|
|
adduser --gecos $USER --disabled-login $USER --uid $UGID
|
|
|
|
echo "I: set user $USER password to $USER"
|
|
echo "$USER:$USER" | chpasswd
|
|
|
|
chown -R $UGID:$UGID /home/$USER
|
|
|
|
# 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
|