password for regular user

This commit is contained in:
brent s. 2014-12-21 11:41:49 -05:00
parent 079ff52d6c
commit cc29913f6d
6 changed files with 25 additions and 4 deletions

View File

@ -74,6 +74,22 @@ LOGFILE="${BASEDIR}/logs/$(date +%s)"
# What should the regular username be? (Automatically logged in on boot)
REGUSR="${UXNAME}"

# Should the REGUSR have a password? IF THIS IS NOT SET, THE PASSWORD WILL BE BLANK!
# Do NOT use a plaintext password here. You will need to generate a salted and hashed string
# in a shadow-compatible format.
# Debian can do this with the mkpasswd utility (it's in Arch's AUR as debian-whois-mkpasswd):
# mkpasswd --method=sha-512 --salt=aBcDeFgHiJ PASSWORD
# (If a salt is not provided, one will be automatically generated. That is is the suggested method.)
# Or perl:
# perl -e 'print crypt("PASSWORD","\$6\$aBcDeFgHiJ\$") . "\n"'
# Or python:
# python -c "import crypt, getpass, pwd; print crypt.crypt('PASSWORD', '\$6\$aBcDeFgHiJ\$')"
# Or grub-crypt, even:
# /sbin/grub-crypt --sha-512
# The end-product should look something like this:
# $6$aBcDeFgHiJ$Yh342vFH7MOjPNu9InFymD1Dd42i5cFsr1cTWdpKGNIkbRGR/ZKQDRPJ1ZeeGb7y894Tfh3iWZIJKu3phlsqQ1
REGUSR_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

@ -24,7 +24,7 @@ function will_it_blend () {

if [[ "${I_AM_A_RACECAR}" == "y" ]];
then
RACECAR_CHK='nice -n "-19" '
RACECAR_CHK='nice -n -19 '
else
RACECAR_CHK=""
fi

View File

@ -4,7 +4,7 @@ function stuffy {

if [[ "${I_AM_A_RACECAR}" == "y" ]];
then
RACECAR_CHK='nice -n "-19" '
RACECAR_CHK='nice -n -19 '
else
RACECAR_CHK=""
fi

View File

@ -12,7 +12,7 @@ function yo_dj () {

if [[ "${I_AM_A_RACECAR}" == "y" ]];
then
RACECAR_CHK='nice -n "-19" '
RACECAR_CHK='nice -n -19 '
else
RACECAR_CHK=""
fi

View File

@ -14,7 +14,7 @@ function mentos {

if [[ "${I_AM_A_RACECAR}" == "y" ]];
then
RACECAR_CHK='nice -n "-19" '
RACECAR_CHK='nice -n -19 '
else
RACECAR_CHK=""
fi

View File

@ -196,6 +196,7 @@ EOF
set +e
${CHROOTCMD} ${i}/ bash -c "yaourt -S --needed --noconfirm linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
set -e
#${CHROOTCMD} ${i}/ bash -c "yaourt -S --needed --noconfirm debian-whois-mkpasswd" >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo -n "Regular packages..."
set +e
@ -208,6 +209,10 @@ EOF
${CHROOTCMD} ${i}/ passwd -d ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1
mkdir -p ${i}/etc/sudoers.d ; chmod 750 ${i}/etc/sudoers.d
echo "${REGUSR} ALL=(ALL) ALL" >> ${i}/etc/sudoers.d/${REGUSR}
if [ -n "${REGUSR_PASS}" ];
then
${CHROOTCMD} ${i}/ echo "${REGUSR}:${REGUSR_PASS}" | chpasswd -e
fi
echo "Done."
done