Raspi Home Setup
Raspberry Pi Home Setup
A history of how my two raspberry pi headless machines were set up at home.
Future
Consider writing a service to detect and deliver changes to raspberry PI IP addresses over a static location such as digitalocean/flask.
Configuration
System
-
Apt
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install vim git tree tmux pwgen fail2ban
-
SSH Port
- Add additional ssh port
Port 2200
to/etc/ssh/sshd_config
- Set
PermitRootLogin
to 'no' in/etc/ssh/sshd_config
- Restart ssh server:
sudo service sshd restart
- Add ssh port forwarding on router
- Add additional ssh port
-
Static IP:
sudo vim /etc/dhcpcd.conf
- Append this to the file (change as necessary):
interface eth0
static ip_address=192.168.1.111
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
raspi-config
-
FIRST: Advanced Options -> Update (update the tool)
- Note: if this triggers an update, this file will need updated too.
-
Expand Filesystem (select it to auto expand)
-
Change User Password:
pi
password to apwgen -cn 12
password -
Boot Options -> Console
-
Internationalization
- Set timezone to
Pacific Ocean
- Set keyboard to
101-key
,US Standard
- Set wifi country to
United States
- Set timezone to
-
Advanced Options
- Hostname -> Change to desired hostname
- Memory Split -> 16 (headless needs no gpu)
- SSH -> Enable (default)
User Management
-
Add user
adduser robbintt
- use a newpwgen -cn 12
password. Add robbintt tosudo
group- Create SSH keys
ssh-keygen
- Add SSH pubkey to bitbucket dotfiles.git as deployment key
cd ~; git clone git@bitbucket.org:robbintt/dotfiles.git .dotfiles
- Unpack dotfile symlinks w/
make_symlinks.sh
script - Log in as user, delete any
pi
account ssh keys. - Configure dotfiles ssh to include user, port.
- Add authorized_keys from other machines as necessary and update .ssh/config in dotfiles. Redeploy dotfiles.
-
Remove
pi
NOPASSWD sudo priveleges invisudo