Compare commits
2 Commits
401df4602a
...
668ea5c5e2
| Author | SHA1 | Date | |
|---|---|---|---|
| 668ea5c5e2 | |||
| 8dd3bbe8a3 |
16
bootstrap.sh
16
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
|
||||
|
||||
Reference in New Issue
Block a user