From 98c845c224fa83ac22eccd7ed376429d84a2353f Mon Sep 17 00:00:00 2001 From: Marcel Stangenberger Date: Sun, 6 Apr 2025 11:12:02 +0000 Subject: [PATCH] Nocol broken, fix attempt --- post/run.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/post/run.sh b/post/run.sh index 4fb8400..a85d115 100644 --- a/post/run.sh +++ b/post/run.sh @@ -5,7 +5,8 @@ GREEN='\033[0;32m' RED='\033[0;31m' NOCOL='\033[om' -echo -e "${GREEN}Setting remote control requirements...${NOCOL}" +echo -e "${GREEN}Setting remote control requirements..." +echo -e ${NOCOL} groupadd admins useradd -g admins -m -r -c "System administrator" sysadmin echo "%admins ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/admins @@ -14,25 +15,30 @@ chmod 700 /home/sysadmin/.ssh curl -so /home/sysadmin/.ssh/authorized_keys $REPO/raw/master/post/ansible.pub chown -R sysadmin:admins /home/sysadmin/.ssh -echo -e "${GREEN}Disable root user SSH access...${NOCOL}" +echo -e "${GREEN}Disable root user SSH access..." +echo -e ${NOCOL} sed -i 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config sed -i 's/PermitRootLogin without-password/PermitRootLogin no/' /etc/ssh/sshd_config -echo -e "${GREEN}Configuring and enabling default firewall...${NOCOL}" +echo -e "${GREEN}Configuring and enabling default firewall..." +echo -e ${NOCOL} curl -so /etc/iptables/iptables.rules $REPO/raw/master/post/iptables.rules curl -so /etc/iptables/ip6tables.rules $REPO/raw/master/post/ip6tables.rules systemctl enable iptables systemctl enable ip6tables -echo -e "${GREEN}Install minimal required packages...${NOCOL}" +echo -e "${GREEN}Install minimal required packages..." +echo -e ${NOCOL} pacman --noconfirm -S iftop htop bash-completion iotop lsof screen neofetch neovim man-db ln -s /usr/bin/nvim /usr/bin/vi -echo -e "${GREEN}Setup motd default...${NOCOL}" +echo -e "${GREEN}Setup motd default..." +echo -e ${NOCOL} echo "" > /etc/motd echo "neofetch" >> /etc/profile.d/neofetch.sh chmod +x /etc/profile.d/neofetch.sh -echo -e "${RED}All done, reboot in 10 seconds...${NOCOL}" +echo -e "${RED}All done, reboot in 10 seconds..." +echo -e ${NOCOL} sleep 10 reboot