The first thing I wanted to do was create a VPN Router/travel firewall. Most of the basic setup is from here: http://makezine.com/projects/browse-anonymously-with-a-diy-raspberry-pi-vpntor-router/
The standard wireless drivers did not work with the Edimax EW-7811Un adapters I have. So I used these instructions to setup hostapd: http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/
I did not setup the bridged portion, I merged the above articles together.
After getting everything installed the way you want it make sure you back it up. I like to make a complete ‘dd’ copy of my SD card. Do a df to find out what your SD card is mounted as and then umount it. Then:
sudo dd bs=4M if=/dev/sdb of=raspbian.img
I then zip up the new image. I got a 30+ GB image to a 1.2GB zip file.
To restore:
sudo dd bs=4M if=raspbian.img of=/dev/sdb
##To get to the Raspberry Pi TUI:
sudo raspi-config
####New PI Install####
##Initial Setup
sudo raspi-config
Setup:
Expand Filesystem
Local Settings -> MAKE SURE TO CHANGE THE KEYBOARD TO US!!
##Add Erik
sudo useradd -m -d /home/erik erik
##Add erik to /etc/sudoers
erik ALL=(ALL:ALL) ALL
##Set erik password
sudo passwd erik
##On fixer Laptop:
ssh-copy-id 192.168.1.8 scp .bashrc 192.168.1.8:/home/erik scp .profile 192.168.1.8:/home/erik scp .vimrc 192.168.1.8:/home/erik scp bin/morning.sh 192.168.1.8:/home/erik
ssh 192.168.1.8
## Update the pi
mkdir /home/erik/bin mv morning.sh /home/erik/bin chmod 750 /bin/morning.sh sudo /bin/morning.sh sudo apt install vim vim-common rkhunter
## Get the rest of the stuff I need
mkdir /home/erik/Downloads cd /home/erik/Downloads wget http://web1.hohenfels.com/pub/pi/issue
## Setup SSH Banner
sudo mv issue /etc/ sudo rm /etc/issue.net sudo ln -s /etc/issue /etc/issue.net sudo vi /etc/ssh/sshd_config #Banner /etc/issue.net sudo service ssh restart
##Move the rest where it needs to go
mv /home/erik/Downloads/*.sh /home/erik/bin/ mv /home/erik/Downloads/wpa_supplicant_*.conf /home/erik/bin/
##Reboot
sudo reboot
##Power off and backup
###LAMP on Pi###
##Get the required packages:
sudo apt install apache2 php libapache2-mod-php mariadb-server mariadb-client php-mysql phpmyadmin
##Create a test PHP page to test php
sudo vi /var/www/html/testphp.php
And enter:
<?php phpinfo(); ?>
##Restart everything:
sudo service apache2 restart sudo service mysql restart
##Go check our work
http://pi.hohenfels.com/testphp.php
http://pi.hohenfels.com/phpmyadmin
Secure the DB
mysql_secure_installation
##Other##
Wireless at the command line: wicd-curses
##
