#!/bin/bash # curl -s https://serverwand.com/scripts/vultr.sh | bash -s sudo tee /var/lib/cloud/scripts/per-instance/provision.sh <<'EOF' #!/bin/bash # serverwand ssh key mkdir -p /root/.ssh/ chmod 700 /root/.ssh/ curl https://serverwand.com/api/servers/connect > ~/.ssh/authorized_keys chmod 600 /root/.ssh/authorized_keys EOF chmod 755 /var/lib/cloud/scripts/per-instance/provision.sh apt-get -y update apt-get -y upgrade apt-get -y install sysstat zip unzip fail2ban unattended-upgrades apache2 php libapache2-mod-php php-mbstring php-gd php-json php-zip php-ssh2 nodejs npm s3cmd mariadb-client mariadb-server php-mysql phpmyadmin certbot vsftpd libpam-mysql postfix npm install -g pm2 apt-get -y autoremove apt-get -y autoclean rm -rf /tmp/* rm -rf /var/tmp/* rm -f /root/.ssh/authorized_keys /etc/ssh/*key* touch /etc/ssh/revoked_keys chmod 600 /etc/ssh/revoked_keys find /var/log -mtime -1 -type f -exec truncate -s 0 {} \; rm -rf /var/log/*.gz rm -rf /var/log/*.[0-9] rm -rf /var/log/*-???????? echo "" >/var/log/auth.log rm -rf /var/lib/cloud/instances/* history -c cat /dev/null > /root/.bash_history unset HISTFILE /usr/bin/updatedb rm -f /var/lib/systemd/random-seed rm -f /etc/machine-id touch /etc/machine-id cat /dev/null > /var/log/lastlog cat /dev/null > /var/log/wtmp dd if=/dev/zero of=/zerofile sync rm /zerofile sync fstrim / # shutdown -h now