diff --git a/bootstrap.sh b/bootstrap.sh index d8da7b3..0d67a09 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -89,7 +89,7 @@ sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd systemctl restart sshd # Nettoyage différé -nohup /root/first-login-cleaner.sh >/dev/null 2>&1 & +nohup /root/firstlogincleaner.sh >/dev/null 2>&1 & exit 0 EOF chmod +x $TEMP_SCRIPT @@ -99,8 +99,8 @@ chmod +x $TEMP_SCRIPT cat << 'EOF' > $TEMP_SCRIPT_WRAPPER #!/bin/bash -if [ -f /root/first-login.sh ]; then - /root/first-login.sh +if [ -f /root/firstlogin.sh ]; then + /root/firstlogin.sh fi exit 0 @@ -115,18 +115,18 @@ cat << 'EOF' > $TEMP_SCRIPT_CLEANER sleep 10 # Supprimer la ligne PAM -sed -i '/first-login-wrapper.sh/d' /etc/pam.d/sshd +sed -i '/firstloginwrapper.sh/d' /etc/pam.d/sshd # Supprimer les scripts -rm -f /root/first-login.sh -rm -f /root/first-login-wrapper.sh -rm -f /root/first-login-cleaner.sh +rm -f /root/firstlogin.sh +rm -f /root/firstlogin-wrapper.sh +rm -f /root/firstlogin-cleaner.sh exit 0 EOF chmod +x $TEMP_SCRIPT_CLEANER -echo "auth optional pam_exec.so stdout /root/first-login-wrapper.sh" >> /etc/pam.d/sshd +echo "auth optional pam_exec.so stdout /root/firstloginwrapper.sh" >> /etc/pam.d/sshd #################. Hardening binaries