My Initial Setup stackscript
my startup StackScript
It can do the following:
1. update (only package list) or upgrade (full upgrade) system
2.1. set hostname
2.2. add host entry with hostname to address 127.0.1.1
3. set up colorful bash prompt
4. set up a standard user with sudo privilege using a user defined login shell
5.1. set up SSH public key for a specified user
5.2. disable password login for SSH
5.3. disable root login for SSH
5.4. restrict SSH access to only IPV4 or IPV6
6. set up some common packages (git, wget, tar, gzip, lzip, bc, inxi, build-essential)
7. set up fail2ban
8.1 set up ufw
8.2 ufw: allow ftp, ssh, http, https and mail server ports
8.3 ufw: deny all incoming
8.4 ufw: allow all outgoing
9. set up sendmail
10.1 set up apache2
10.2 apache2 tuning for low memory
11.1 set up mysql
11.2 mysql tuning for security
11.3 mysql tuning for low memory
The logs are saved in /var/cache/initserver.sh.log file