Browse code

Change password max days to 99999 for cloud images

Change-Id: I26c57c7aef5ea4ade67822f9fac3867f0fcf8611
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/1364
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: suezzelur <anishs@vmware.com>

suezzelur authored on 2016/09/10 07:30:01
Showing 1 changed files
... ...
@@ -134,6 +134,9 @@ if [ $IMG_NAME != "ova" ] && [ $IMG_NAME != "ova_uefi" ] && [ $IMG_NAME != "ova_
134 134
         echo "chrooting and running patch inside the chroot"
135 135
         chroot $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME} /bin/bash -c "/$IMG_NAME-patch.sh"
136 136
         rm -f $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/$IMG_NAME-patch.sh
137
+        # Change the max password days to 99999
138
+        chroot $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME} /bin/bash -c "cat /etc/shadow | cut -d: -f1 | xargs -I {} chage -I -1 -m 0 -M 99999 -E -1 -W 7 {}"
139
+        sed -i 's/^PASS_MAX_DAYS.*/PASS_MAX_DAYS   99999/' $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/etc/login.defs
137 140
     fi
138 141
 fi
139 142
 umount $PHOTON_IMG_OUTPUT_PATH/photon-${IMG_NAME}/sys