#!/bin/bash

################## Run the follwing on puppet to create the grub password
# grub2-mkpasswd-pbkdf2

################## Add the follwing to a newly created /etc/grub.d/01_users  (USING THE GRUB PASSWORD YOU JUST CREATED IN PLACE OF MINE)

#### make sure the '!/bin/sh' -e statment is included

echo 'cat << EOF' >> /etc/grub.d/01_users
echo 'set superusers="root"' >> /etc/grub.d/01_users
echo 'password_pbkdf2 root grub.pbkdf2.sha512.10000.75D9C30072CB04E0FA857D0DCB7068CAA08B61AE91D4DE4D382C8E380324385182DD214C8C77F03F480D4EF9CED2C79DDC0914A2556374088A3A80983D80250C.168335DA57E27FDED66BDA25FF9A1473C266DF0BA69CC00015CDE3A7CB7964DED4F7E1AABC5A0AD4D8D17B33D4E517DF14772894DD81D1E6BFD39840B6038672' >> /etc/grub.d/01_users


################### Change the permissions on the 01_users file
chmod 755 /etc/grub.d/01_users

#####################  Run the following command after to update the grub file
grub2-mkconfig -o /boot/grub2/grub.cfg
