Update dapostinstall.sh

This commit is contained in:
Marek Miklewicz
2025-03-30 22:22:18 +02:00
parent a27d8d8e9d
commit d50edd778b
+6 -9
View File
@@ -135,21 +135,18 @@ sed -i "s/,22,/,22,10022,/g" /etc/csf/csf.conf
echo "Ustawienie dodatkowych zabezpieczen SSH"
tee -a /etc/ssh/sshd_config > /dev/null <<EOT
Match User root Address 185.242.134.0/24,185.242.133.37,185.242.134.92,185.242.134.93,193.177.165.192,193.177.165.193,193.177.165.194,193.177.165.195,193.177.165.196
PubkeyAuthentication yes
PasswordAuthentication yes
PermitRootLogin yes
EOT
if ! grep -q '^Match User root' /etc/ssh/sshd_config; then
daupdate secssh
fi
echo "Ustawienie kluczy logowania do DirectAdmina i kluczy SSH hitme"
daupdate klucze
if ! grep -q '^Match User root' /etc/ssh/sshd_config; then
if ! grep -Fq '185.242.134.92' /root/.ssh/authorized_keys; then
daupdate keyput
fi
daupdate klucze
cd $DAPOSTINSTALL_DIR
echo "Instalacja Modsecurity i regułek malware experts"