Answer the question
In order to leave comments, you need to log in
CentOS 7 kickstart and password in md5 not working?
Actually the question, earlier, in version 5-6, worked, asked
rootpw --iscrypted HASH # Генерируем с помощью php crypt()
authconfig --enableshadow --passalgo=md5
authconfig --passalgo=sha512 --update # меняем на sha512
Answer the question
In order to leave comments, you need to log in
I have a script that creates kickstarts and does it like this:
read -p "Enter root password or leave empty for random: " ROOT_PW
if [ -z "${ROOT_PW}" ] ; then
# генерируем пароль для root
ROOT_PW=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 15 | xargs`
fi
# шифруем пароль так
ROOT_PW_SALT=`tr -dc A-Za-z0-9_ < /dev/urandom | head -c 16 | xargs`
ROOT_PWCRYPTED=`echo -e "${ROOT_PW}\n${ROOT_PW_SALT}" | python -c 'import crypt; print crypt.crypt(raw_input(), "\$6\$" + raw_input() + "\$")'`
....
KSFILE=`cat <<EOFINLINEFILE
text
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --hostname ${HOST_NAME}
rootpw --iscrypted ${ROOT_PWCRYPTED}
authconfig --enableshadow --passalgo=sha512
firewall --service=ssh
selinux --permissive
timezone --utc Etc/UTC
....
echo -e "${ROOT_PW}" | python -c 'import crypt; print(crypt.crypt(raw_input(), crypt.mksalt(crypt.METHOD_SHA512)))'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question