From 78ca2defaa58c79ed6bd1a4bba8f3540fb165686 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sat, 12 Mar 2016 16:24:46 +0100 Subject: [PATCH] disable password againg for root --- common/prepare-vagrant-user.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/prepare-vagrant-user.sh b/common/prepare-vagrant-user.sh index ae516e9..f45238a 100755 --- a/common/prepare-vagrant-user.sh +++ b/common/prepare-vagrant-user.sh @@ -22,6 +22,12 @@ elif [ ${DISTRIBUTION} = 'centos' -o ${DISTRIBUTION} = 'fedora' ]; then chroot ${ROOTFS} useradd --create-home -s /bin/bash -u 1000 vagrant &>> ${LOG} echo -n 'vagrant:vagrant' | chroot ${ROOTFS} chpasswd sed -i 's/^Defaults\s\+requiretty/# Defaults requiretty/' $ROOTFS/etc/sudoers + if [ ${RELEASE} -eq 6 ]; then + info 'Disabling password aging for root...' + # disable password aging (required on Centos 6) + # pretend that password was changed today (won't fail during provisioning) + chroot ${ROOTFS} chage -I -1 -m 0 -M 99999 -E -1 -d `date +%Y-%m-%d` root + fi else debug 'Creating vagrant user...' chroot ${ROOTFS} useradd --create-home -s /bin/bash vagrant &>> ${LOG}