mirror of
https://github.com/weyne85/Nextcloud-Installationsskript.git
synced 2025-10-29 16:59:26 +00:00
Create ips.sh
This commit is contained in:
parent
e1d777c7e2
commit
c32e406b3c
59
ips.sh
Normal file
59
ips.sh
Normal file
@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
##########################################################################################
|
||||
# CROWDSEC INSTALLATION
|
||||
##########################################################################################
|
||||
# Debian 12 / Ubuntu 22.04+ LTS x86_64
|
||||
# Carsten Rieger IT-Services (https://www.c-rieger.de)
|
||||
##########################################################################################
|
||||
clear
|
||||
if [ "$USER" != "root" ]
|
||||
then
|
||||
echo ""
|
||||
echo " » KEINE ROOT-BERECHTIGUNGEN | NO ROOT PERMISSIONS"
|
||||
echo ""
|
||||
echo "----------------------------------------------------------"
|
||||
echo " » Bitte starten Sie das Skript als root: 'sudo ./ips.sh'"
|
||||
echo " » Please run this script as root using: 'sudo ./ips.sh'"
|
||||
echo "----------------------------------------------------------"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
echo " » fail2ban wird entfernt // remove fail2ban"
|
||||
echo ""
|
||||
sleep 2
|
||||
systemctl stop fail2ban.service
|
||||
systemctl disable fail2ban.service
|
||||
systemctl mask fail2ban.service
|
||||
apt remove fail2ban --purge -y
|
||||
clear
|
||||
echo ""
|
||||
echo " » fail2ban entfernt // removed [OK]"
|
||||
echo " » Crowdsec wird heruntergeladen+installiert // crowdsec will be downloaded+installed"
|
||||
echo ""
|
||||
sleep 2
|
||||
curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash
|
||||
apt install crowdsec -y
|
||||
apt install crowdsec-firewall-bouncer-nftables -y
|
||||
systemctl enable --now crowdsec.service
|
||||
cscli collections install crowdsecurity/nextcloud
|
||||
cscli collections install crowdsecurity/nginx
|
||||
cscli collections install crowdsecurity/sshd
|
||||
systemctl reload crowdsec && systemctl restart crowdsec
|
||||
cp /etc/crowdsec/acquis.yaml /etc/crowdsec/acquis.yaml.bak
|
||||
cat <<EOF >>/etc/crowdsec/acquis.yaml
|
||||
#Nextcloud by c-rieger.de
|
||||
filenames:
|
||||
- /var/log/nextcloud/nextcloud.log
|
||||
labels:
|
||||
type: Nextcloud
|
||||
---
|
||||
EOF
|
||||
systemctl reload crowdsec && systemctl restart crowdsec.service crowdsec-firewall-bouncer.service
|
||||
clear
|
||||
echo ""
|
||||
echo " » fail2ban entfernt // removed [OK]"
|
||||
echo " » crowdsec installiert // installed [OK]"
|
||||
echo " » Carsten Rieger IT-Services, https://www.c-rieger.de"
|
||||
echo ""
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user