From f7ade7918e13c1699583c661d104c249afa3984d Mon Sep 17 00:00:00 2001 From: TommyTran732 <57488583+tommytran732@users.noreply.github.com> Date: Sun, 4 Apr 2021 10:35:46 +0000 Subject: [PATCH] Update Ubuntu-Desktop-20.04-LTS.sh --- Ubuntu-Desktop-20.04-LTS.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Ubuntu-Desktop-20.04-LTS.sh b/Ubuntu-Desktop-20.04-LTS.sh index 06adb05..88900ee 100644 --- a/Ubuntu-Desktop-20.04-LTS.sh +++ b/Ubuntu-Desktop-20.04-LTS.sh @@ -15,6 +15,29 @@ output(){ echo -e '\e[36m'$1'\e[0m'; } +promptPassphrase() { + PASS="" + PASSCONF="" + while [ -z "$PASS" ]; do + read -s -p "Passphrase: " PASS + echo "" + done + + while [ -z "$PASSCONF" ]; do + read -s -p "Confirm passphrase: " PASSCONF + echo "" + done + echo "" +} + +getPassphrase() { + promptPassphrase + while [ "$PASS" != "$PASSCONF" ]; do + output "Passphrases did not match, try again..." + promptPassphrase + done +} + #Moving to the home directory #Note that I always use /home/${USER} because gnome-terminal is wacky and sometimes doesn't load the environment variables in correctly (Right click somewhere in nautilus, click on open in terminal, then hit create new tab and you will see.) cd /home/${USER} || exit @@ -56,7 +79,7 @@ echo "blacklist firewire-sbp2" | sudo tee /etc/modprobe.d/blacklist.conf #GRUB hardening (Thanks to https://www.ncsc.gov.uk/collection/end-user-device-security/platform-specific-guidance/ubuntu-18-04-lts) echo -e "${HIGHLIGHT}Configuring grub...${NC}" -echo "Please enter a grub sysadmin passphrase..." +output "Please enter a grub sysadmin passphrase..." getPassphrase echo "set superusers=\"sysadmin\"" >> /etc/grub.d/40_custom