adduser {{username}}usermod -aG sudo {{username}}passwd {{username}}mkdir /home/{{username}}/.sshvi /home/{{username}}/.ssh/authorized_keysCopy a SSH from your local machine e.g. ~/.ssh/id_rsa.pub
Paste into the authorized_keys file on the remote machine
ssh {{username}}@{{ip_address}}vi /etc/ssh/sshd_config(generally about halfway down the file)
PasswordAuthentication no
Note: you may have to run some of this as a Super User $ su
apt-get update && apt-get dist-upgrade -y
apt-get autoremove -y
apt-get updateapt-get install zsh && git-core
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
chsh -s `which zsh`Note: Leave (exit) and re-login (ssh {{username}}@{{ip_address}})
apt-get install -y build-essential python-software-properties python g++ make fail2ban curl git htop ntp ntpdate unzip nanodpkg-reconfigure tzdatasudo apt-get install apache2
sudo ufw app list
sudo ufw allow in "Apache Full"
sudo ufw allow in "OpenSSH"
sudo ufw enable
sudo ufw status verbose
sudo systemctl restart apache2sudo chgrp -R www-data /var/www/html
sudo find /var/www/html -type d -exec chmod g+rx {} +
sudo find /var/www/html -type f -exec chmod g+r {} +sudo chmod 775 -R /var/www/htmlsudo adduser {{username}} www-datasudo vi /etc/apache2/apache2.confNote: Use ? to find in Vim and search for Directory /var/www/
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>sudo vi /var/www/html/.htaccessOptions +Indexes
<Files *>
AuthType Basic
AuthName "Please enter your username and password."
AuthUserFile /var/www/html/.htpasswd
Require valid-user
</Files>Note: This creates a basic HTTP authorization Ref: MDN HTTP authentication
sudo htpasswd -bc .htpasswd {{user}} {{password}}Note: Restart Apache for good measure
sudo systemctl restart apache2sudo apt-get install php libapache2-mod-php php-mcrypt php-mysqlsudo vi /etc/apache2/mods-enabled/dir.conf // Change From
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
// To
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htmRef: Helpful Stack Overflow on Permissions
sudo apt-get install php-cli