My random thoughts, but version controlled.
Notes on my Raspberry Pi configuration.
pi
raspberry
$ sudo passwd root
pi
user to shad
.
# usermod -l shad pi
# usermod -m -d /home/shad shad
$ sudo raspi-config
$ sudo systemctl enable ssh
$ sudo systemctl start ssh
$ sudo lsblk -o name,label,size,mountpoint
NAME LABEL SIZE MOUNTPOINT
sda 465.8G
├─sda1 boot 256M /boot
└─sda2 rootfs 465.5G /
sdb 1.8T
└─sdb1 tanpopo 1.8T
sdc 4.6T
└─sdc1 ajisai 4.6T
sdd 29.8G
├─sdd1 RECOVERY 2.2G
├─sdd2 1K
├─sdd5 SETTINGS 32M
├─sdd6 boot 256M
└─sdd7 root 27.3G /mnt/oldroot
$ sudo mkdir /mnt/oldroot
$ sudo mount /dev/sdd7 /mnt/oldroot
$ scp rootfs.tar.gz shad@avocado.local:
$ sudo apt install archivemount
$ sudo mkdir /mnt/oldroot
$ sudo archivemount -o readonly -o allow_other rootfs.tar.gz /mnt/oldroot
$ cp -a /mnt/oldroot/home/shad/.ssh ~
zsh
history.
$ cp /mnt/oldroot/home/shad/.zsh_history ~
zsh
.
$ sudo apt install zsh
$ chsh
Password:
Changing the login shell for shad
Enter the new value, or press ENTER for the default
Login Shell [/bin/bash]: /usr/bin/zsh
$ sudo apt install vim git curl tmux
tmux
and install plugins by pressing ctrl+a, I
.dotfiles
.
$ git clone git@github.com:shadanan/dotfiles.git .dotfiles
$ .dotfiles/install
sudo
$ sudo visudo
shad ALL=(ALL) NOPASSWD:ALL
$ sudo apt install libpam-google-authenticator
$ google-authenticator
/etc/pam.d/sshd
.# Google Two Factor Authentication
auth required pam_google_authenticator.so
/etc/ssh/sshd_config
, change ChallengeResponseAuthentication
from no
to yes
.sshd
daemon.
$ sudo systemctl restart sshd.service
/etc/apt/sources.list
with:deb http://deb.debian.org/debian unstable main contrib non-free
$ sudo apt update
$ sudo apt dist-upgrade
$ sudo apt-get autoremove
$ sudo reboot
/etc/motd
🥑.shad.io
$ sudo dpkg-reconfigure console-setup
/boot/config.txt
, uncomment disable_overscan=1
.ddclient
.
$ sudo apt install ddclient
esc
to skip config screens.$ sudo cp /mnt/oldroot/etc/ddclient.conf /etc/ddclient.conf
#usev6=if
#if=eth0
protocol=dyndns2
use=web
ssl=yes
server=domains.google.com
login=<get this from domains.google.com>
password=<get this from domains.google.com>
*.shad.io
ddclient
service.
$ sudo systemctl restart ddclient
/var/log/syslog
.
$ tail /var/log/syslog
$ sudo lsblk -o name,label,size,mountpoint
NAME LABEL SIZE MOUNTPOINT
sda 465.8G
├─sda1 boot 256M /boot
└─sda2 rootfs 465.5G /
sdb 1.8T
└─sdb1 tanpopo 1.8T
sdc 4.6T
└─sdc1 ajisai 4.6T
sdd 29.8G
├─sdd1 RECOVERY 2.2G
├─sdd2 1K
├─sdd5 SETTINGS 32M
├─sdd6 boot 256M
└─sdd7 root 27.3G /mnt/oldroot
/etc/fstab
.LABEL=tanpopo /mnt/tanpopo exfat defaults,auto,uid=1000,gid=1000,umask=0022,users,rw,nofail 0 0
LABEL=ajisai /mnt/ajisai exfat defaults,auto,uid=1000,gid=1000,umask=0022,users,rw,nofail 0 0
exfat
.
$ sudo apt install exfat-fuse exfat-utils
$ sudo mkdir /mnt/tanpopo /mnt/ajisai
$ sudo mount /mnt/tanpopo
$ sudo mount /mnt/ajisai
Install samba
$ sudo apt install samba
Create shares for the mounted volumes in /etc/samba/smb.conf
:
[tanpopo]
comment = Tanpopo 2TB External Drive
valid users = shad
path = /mnt/tanpopo
read only = no
guest ok = no
[ajisai]
comment = Ajisai 5TB External Drive
valid users = shad
path = /mnt/ajisai
read only = no
guest ok = no
Set the password for user shad
.
$ sudo smbpasswd -a shad
Restart the smbd.service
.
$ sudo systemctl restart smbd.service
transmission-daemon
.
$ sudo apt install transmission-daemon
shad
.
$ sudo systemctl edit transmission-daemon.service
[Service]
User=shad
$ sudo systemctl restart transmission-daemon
~/.config/transmission-daemon/settings.json
."rpc-username": "shad"
"rpc-password": "<new password>"
"rpc-whitelist": "192.168.*.*"
"rpc-host-whitelist-enabled": false
$ sudo systemctl reload transmission-daemon.service
$ sudo apt install golang
Install Caddy.
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
$ curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
$ sudo apt update
$ sudo apt install caddy
Configure reverse proxies by adding the following to /etc/caddy/Caddyfile
:
mixair.shad.io {
reverse_proxy localhost:8000
}
covid.shad.io {
reverse_proxy localhost:8501
}
brita.shad.io {
reverse_proxy localhost:8502
}
Restart Caddy.
$ sudo systemctl restart caddy.service