dracut/adduser.sh: add anon user to the adm group; redirect std{err,in} to /dev/null.
This commit is contained in:
parent
b7aa53a6c6
commit
f7b2c93354
@ -12,7 +12,7 @@ echo "USERNAME=$USERNAME" >> ${NEWROOT}/etc/default/live.conf
|
|||||||
chmod 644 ${NEWROOT}/etc/default/live.conf
|
chmod 644 ${NEWROOT}/etc/default/live.conf
|
||||||
|
|
||||||
# Create new user and remove password. We'll use autologin by default.
|
# Create new user and remove password. We'll use autologin by default.
|
||||||
chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G audio,video,wheel -s /bin/sh
|
chroot ${NEWROOT} useradd -c $USERNAME -m $USERNAME -G adm,wheel -s /bin/sh
|
||||||
chroot ${NEWROOT} passwd -d $USERNAME 2>&1 >/dev/null
|
chroot ${NEWROOT} passwd -d $USERNAME 2>&1 >/dev/null
|
||||||
|
|
||||||
# Enable sudo permission by default.
|
# Enable sudo permission by default.
|
||||||
@ -20,9 +20,8 @@ if [ -f ${NEWROOT}/etc/sudoers ]; then
|
|||||||
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
|
echo "${USERNAME} ALL=(ALL) NOPASSWD: ALL" >> ${NEWROOT}/etc/sudoers
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chroot ${NEWROOT} systemctl disable graphical.target
|
chroot ${NEWROOT} systemctl disable graphical.target 2>&1 >/dev/null
|
||||||
chroot ${NEWROOT} systemctl enable multi-user.target
|
chroot ${NEWROOT} systemctl enable multi-user.target 2>&1 >/dev/null
|
||||||
touch ${NEWROOT}/etc/sysctl.conf
|
|
||||||
|
|
||||||
# Enable autologin for agetty(8).
|
# Enable autologin for agetty(8).
|
||||||
if [ -f ${NEWROOT}/usr/lib/systemd/system/getty@.service ]; then
|
if [ -f ${NEWROOT}/usr/lib/systemd/system/getty@.service ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user