Update bootstrap.sh
This commit is contained in:
16
bootstrap.sh
16
bootstrap.sh
@@ -89,7 +89,7 @@ sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/' /etc/ssh/sshd
|
|||||||
systemctl restart sshd
|
systemctl restart sshd
|
||||||
|
|
||||||
# Nettoyage différé
|
# Nettoyage différé
|
||||||
nohup /root/first-login-cleaner.sh >/dev/null 2>&1 &
|
nohup /root/firstlogincleaner.sh >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod +x $TEMP_SCRIPT
|
chmod +x $TEMP_SCRIPT
|
||||||
@@ -99,8 +99,8 @@ chmod +x $TEMP_SCRIPT
|
|||||||
cat << 'EOF' > $TEMP_SCRIPT_WRAPPER
|
cat << 'EOF' > $TEMP_SCRIPT_WRAPPER
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -f /root/first-login.sh ]; then
|
if [ -f /root/firstlogin.sh ]; then
|
||||||
/root/first-login.sh
|
/root/firstlogin.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
@@ -115,18 +115,18 @@ cat << 'EOF' > $TEMP_SCRIPT_CLEANER
|
|||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
# Supprimer la ligne PAM
|
# 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
|
# Supprimer les scripts
|
||||||
rm -f /root/first-login.sh
|
rm -f /root/firstlogin.sh
|
||||||
rm -f /root/first-login-wrapper.sh
|
rm -f /root/firstlogin-wrapper.sh
|
||||||
rm -f /root/first-login-cleaner.sh
|
rm -f /root/firstlogin-cleaner.sh
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod +x $TEMP_SCRIPT_CLEANER
|
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
|
#################. Hardening binaries
|
||||||
|
|||||||
Reference in New Issue
Block a user