Update bootstrap.sh

This commit is contained in:
2026-06-12 17:57:02 +02:00
parent 89d496bfdd
commit 8dd3bbe8a3

View File

@@ -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