From fe564a5ab91d967441748048513b361e4fce1157 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Apr 2014 13:01:24 +0200 Subject: set random root password --- elchos/root-image/root/customize_root_image.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'elchos') diff --git a/elchos/root-image/root/customize_root_image.sh b/elchos/root-image/root/customize_root_image.sh index ffad251e..ca6a21dd 100755 --- a/elchos/root-image/root/customize_root_image.sh +++ b/elchos/root-image/root/customize_root_image.sh @@ -3,7 +3,7 @@ set -e -u -f -x reaktor_user=reaktor ncdc_user=hooker -rootpw=zahlen8ZaiFe +rootpw=$(dd if=/dev/urandom bs=1 count=100 2>/dev/null |md5sum | awk '{print $1}' | dd bs=1 count=9 2>/dev/null) sed -i 's/#\(en_US\.UTF-8\)/\1/' /etc/locale.gen locale-gen @@ -58,10 +58,8 @@ cp /krebs/painload/Reaktor/etc/systemd/system/Reaktor@.service \ # add bonus features for elch cp -a /krebs/etc/Reaktor /krebs/painload # emergency root passwd +echo "the Root PW is $rootpw" (printf "%s\n%s\n" "$rootpw" "$rootpw" ) | passwd -#sed -i \ -# 's#^root.*#root:$6$OrW0nWn4$w0DYuPz96VYLIEBgRtjjn01Y4lHu/FbbXuZeCqHo81YsYe/IMGxPmLLpPw10JlmA3amemet4VfV6/FSlOxpeK0:16161:15593::::::#' \ -# /etc/shadow cd /krebs/painload/Reaktor/ touch auth.lst admin.lst chown reaktor:reaktor auth.lst admin.lst -- cgit v1.2.3