From 21b9ac3bd398bbb1caa980526c7a2cdbb0db034a Mon Sep 17 00:00:00 2001 From: bprieshof Date: Thu, 18 Oct 2018 15:09:37 +0200 Subject: [PATCH] Update 'Main-Installer.sh' --- Main-Installer.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Main-Installer.sh b/Main-Installer.sh index 4289435..e4e4997 100644 --- a/Main-Installer.sh +++ b/Main-Installer.sh @@ -43,6 +43,18 @@ do esac done +while true; do + read -p "Password login uit zetten -> yes/no?" yn + case $yn in + [Yy]* ) sshkey=1 + break;; + [Nn]* ) sshkey=0 + break;; + * ) echo "Kies yes of no.";; + esac +done + + while true; do read -p "Installeer Cockpit -> yes/no?" yn case $yn in @@ -102,7 +114,7 @@ done # Pre-Config # ##----------------## -sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config +echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOtJ4ZiLi+SntA3m54oEJjlA8bE73gggkhGjOaVHsLNo6YmKtZlPaxwWiGvoATv4Vm41WWxKbUWbYGHVTe8DusqKpf/JCgB1r/8rQe828qwaEGXWGxta1Ykq+ndDeBLFGhVp0nNdcnND5HIwarEW4zhBDXUMzYw7IBxPYb48tVIobs/yPN6nSWT2G8FX7XDJNifS+ThVLnCHHS3i/uio8b8jz1oT2s6UH09EBwxg99+0yVaSQV2q8CthDZ8rSgz8pAhQ6FwVfUd9c/PQjtbUSQStvKvr3muv5Q8UnzAvKiO83rsM91aDwv0E6kqpB77BrkpfQXOJNDmdqlnsa2AlkL ICTMaatwerk@Key" >> ~/.ssh/authorized_keys echo "root:$password" | chpasswd cd /tmp #mv /boot/grub/menu.lst /boot/grub/menu.lst.bck @@ -193,6 +205,12 @@ if [ $cockpit = 1 ]; then source Slave-Installer.sh fi + + +if [ $sshkey = 1 ]; then + sed -i 's/PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config +fi + ##-------------------## # Backup Script # ##-------------------##