oh, why the hell not.

This commit is contained in:
brent s. 2014-12-23 14:59:46 -05:00
parent 5d2d7b14c9
commit f9a3310a0a
2 changed files with 12 additions and 2 deletions

View File

@ -90,6 +90,10 @@ REGUSR="${UXNAME}"
# $6$aBcDeFgHiJ$Yh342vFH7MOjPNu9InFymD1Dd42i5cFsr1cTWdpKGNIkbRGR/ZKQDRPJ1ZeeGb7y894Tfh3iWZIJKu3phlsqQ1
REGUSR_PASS=""

# Same exact thing as REGUSR_PASS, but for the root password (i.e. if no password hash is
# specified, password login will be disabled).
ROOT_PASS=""

# Do we have enough horsepower on the build system to jack up the resources we throw at building?
# Enabling this will give absolute CPU preference to building the kernels and do make-time
# enhancements/optimizations (i.e. use the maximum number of CPU cores detected).

View File

@ -213,9 +213,15 @@ EOF
if [ -n "${REGUSR_PASS}" ];
then
${CHROOTCMD} ${i}/ "echo ${REGUSR}:${REGUSR_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1
else
sed -i -e "s/^${REGUSR}::/${REGUSR}:!:/g" ${i}/etc/shadow
fi
if [ -n "${ROOT_PASS}" ];
then
${CHROOTCMD} ${i}/ "echo ${root}:${ROOT_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1
else
sed -i -e 's/^root::/root:!:/g' ${i}/etc/shadow
fi
# COMMENT THIS LINE IF YOU WANT TO SET A ROOT PASSWORD
sed -i -e 's/^root::/root:!:/g' ${i}/etc/shadow
# The following is supposed to do the same as the above, but "cleaner". However, it currently fails with "execv() failed: No such file or directory"
##${CHROOTCMD} ${i}/ usermod -L root >> "${LOGFILE}.${FUNCNAME}" 2>&1
echo "Done."