#!/bin/sh
#BungeeCloud LXC patcher V0.1
#For Ubuntu and Debian
#Update, SSH Patcher,Modt patcher and Cronjob updater
#!!!SAVE AND EDIT WITH UTF8 AND UNIX(LF)!!!
#wget https://cdn.bungeecloud.org/os/templates/lxcpatcher.sh -O lxcpatcher.sh && sh lxcpatcher.sh; rm lxcpatcher.sh;
apt-get update -y -qq;
apt-get upgrade -y -qq;
apt install nload htop fail2ban nano net-tools -y -qq;
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/#PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config;
service ssh restart;
service sshd restart;
sed -i 's/bantime  = 600/bantime  = 900/g' /etc/fail2ban/jail.conf;
sed -i 's/bantime  = 10m/bantime  = 15m/g' /etc/fail2ban/jail.conf;
wget https://cdn.bungeecloud.org/os/templates/cron.sh -O /var/spool/cron/crontabs/root;
wget https://cdn.bungeecloud.org/os/templates/bashrc.sh -O /root/.bashrc;
echo '' >/var/log/syslog;
echo '' >/var/log/lastlog;
echo "Patch and updates done!";
echo '' >/root/.bash_history;
history -c;