pi:raspbian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pi:raspbian [2020-05-18 14:02] – general network configuration gabriel | pi:raspbian [2020-05-19 09:39] (current) – [Raspbian] updating overview gabriel | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Raspbian ====== | ====== Raspbian ====== | ||
- | This page documents | + | Documentation for my local Raspberry Pi 3 B+ config. |
- | * Disable auto resizing of root partition on boot | + | ===== Before first boot ===== |
- | * Disable quiet boot | + | |
- | * Configure static IP address | + | |
- | * Modify OpenSSH configuration | + | |
- | * Add user | + | |
- | ===== Disable automatic resizing of root partition | + | By default Raspbian attempts to grow the root partition |
- | By default Raspbian attempts to grow the root partition of your system on first boot to fill your entire SD card. | + | |
- | To disable this option do the following. | + | * Remove |
- | + | ||
- | | + | |
- | * Remove / | + | |
===== After first boot ===== | ===== After first boot ===== | ||
Line 26: | Line 19: | ||
apt install vim | apt install vim | ||
update-alternatives --set editor / | update-alternatives --set editor / | ||
- | </ | ||
- | |||
- | ==== Disable Wi-Fi and Bluetooth ==== | ||
- | |||
- | Add the following to / | ||
- | |||
- | < | ||
- | dtoverlay=disable-wifi, | ||
- | </ | ||
- | |||
- | Disable modem service per [[https:// | ||
- | |||
- | < | ||
- | systemctl disable hciuart | ||
</ | </ | ||
==== Disble IPv6 ==== | ==== Disble IPv6 ==== | ||
- | Add the following to / | + | Add the following to '' |
< | < | ||
Line 53: | Line 32: | ||
==== Configure static IP address ==== | ==== Configure static IP address ==== | ||
- | Edit / | + | Edit '' |
< | < | ||
Line 61: | Line 40: | ||
static routers=10.77.3.1 | static routers=10.77.3.1 | ||
static domain_name_servers=10.77.3.4 10.77.3.5 | static domain_name_servers=10.77.3.4 10.77.3.5 | ||
+ | </ | ||
+ | |||
+ | Add our local domain to the default search path configured by '' | ||
+ | |||
+ | < | ||
+ | echo " | ||
</ | </ | ||
Line 74: | Line 59: | ||
==== User configuration ==== | ==== User configuration ==== | ||
- | Add local user | + | The following user modifications are made. |
+ | |||
+ | === local user === | ||
+ | |||
+ | Add local user: | ||
< | < | ||
Line 82: | Line 71: | ||
</ | </ | ||
- | Disable pi user | + | === pi === |
+ | |||
+ | Disable pi user: | ||
< | < | ||
Line 88: | Line 79: | ||
</ | </ | ||
- | Set root password | + | === root === |
+ | |||
+ | Now set root password. | ||
+ | |||
+ | === ansible === | ||
+ | |||
+ | Add ansible user: | ||
+ | |||
+ | < | ||
+ | groupadd -g 1111 ansible | ||
+ | useradd -u 1111 -c " | ||
+ | usermod -p ' | ||
+ | </ | ||
+ | |||
+ | Configure the following sudo rule for ansible: | ||
+ | |||
+ | < | ||
+ | # Ansible control user | ||
+ | ansible ALL=(ALL) NOPASSWD: | ||
+ | </ | ||
+ | |||
+ | Copy SSH keys for Ansible user. | ||
==== Sudoers config ==== | ==== Sudoers config ==== | ||
- | Set timestamp_timeout=NN to more useful timeout value. | + | Set '' |
==== Grow root partition ==== | ==== Grow root partition ==== | ||
- | Use parted and resize2fs to manually set root filesystem size. | + | Use '' |
< | < | ||
Line 111: | Line 123: | ||
==== raspi-config ==== | ==== raspi-config ==== | ||
- | Run the raspi-config tool and set the following options. | + | Run the '' |
* **2 Network Options** -> Hostname -> Set hostname | * **2 Network Options** -> Hostname -> Set hostname | ||
Line 125: | Line 137: | ||
* **A3 Memory Split** -> 16 | * **A3 Memory Split** -> 16 | ||
- | ==== Configure OpenSSH server | + | ==== Additional hardware configuration via config.txt |
- | Disable all keys except ed25519. | + | These settings involve manual configuration of ''/ |
+ | |||
+ | === Disable unneeded networking === | ||
< | < | ||
- | cat " | + | # disable WiFi |
- | cd /etc/ssh/ ** rm -f *key* | + | dtoverlay=disable-wifi |
- | dpkg-reconfigure openssh-server | + | |
+ | # disable Bluetooth | ||
+ | dtoverlay=disable-bt | ||
</ | </ | ||
- | + | Disable modem service | |
- | + | ||
- | + | ||
- | ===== Old: Raspian Jessie Lite instructions ===== | + | |
- | + | ||
- | * Add OpenSSH authorized_keys for root user | + | |
- | * Remove all key types except rsa and ed25519 from sshd_config | + | |
- | * Remove all default keys and regenerate | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * Make '' | + | |
- | * Set static IP address for host by editing ''/ | + | |
< | < | ||
- | # See dhcpcd.conf(5) for details. | + | systemctl disable hciuart |
- | interface eth0 | + | |
- | static ip_address=$IP/ | + | |
- | static routers=$ROUTER | + | |
</ | </ | ||
- | * Set '' | + | === Disable audio driver === |
- | + | ||
- | < | + | |
- | # Configuration for resolvconf(8) | + | |
- | # See resolvconf.conf(5) for details | + | |
- | resolv_conf=/ | + | Comment out the audio driver: |
- | # If you run a local name server, you should uncomment | + | |
- | # configure your subscribers configuration files below. | + | |
- | search_domains=in.quay.net | + | |
- | # BUG WORKAROUND: space separated lists of DNS servers are not currently working | + | |
- | name_servers=$NS1 | + | |
- | name_servers_append=$NS2 | + | |
- | # Mirror the Debian package defaults for the below resolvers | + | < |
- | # so that resolvconf integrates seemlessly. | + | # Enable audio (loads snd_bcm2835) |
- | dnsmasq_resolv=/ | + | #dtparam=audio=on |
- | pdnsd_conf=/ | + | |
- | unbound_conf=/ | + | |
</ | </ | ||
- | * Remove pi default user | + | ==== Configure OpenSSH server ==== |
- | * Remove pi group | + | |
- | * Add new default user and group | + | |
- | * Add sudoers entry for user | + | |
- | * Set password | + | |
- | * Update ntp config; '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * '' | + | |
- | * Set timezone to Toronto: '' | + | |
- | * Remove MOTD text ''> | + | |
- | * Install git and needrestart | + | |
- | Raspbian appears to have issues with managing network dependencies during boot. This script ensures that BIND, dhcpd, and NTP start up correctly after the network interface is properly set up. It is run via ''/ | + | Disable all keys except ed25519. |
< | < | ||
- | #!/bin/bash | + | cat " |
+ | rm -fv / | ||
+ | dpkg-reconfigure openssh-server | ||
+ | </ | ||
- | until fping -qc 3 8.8.8.8 > /dev/null 2>& | + | ==== Packages ==== |
- | echo " | + | |
- | done | + | |
- | for daemon in isc-dhcp-server bind9; do | + | < |
- | echo " | + | vim |
- | | + | ntp |
- | done | + | isc-dhcp-server |
- | + | bind9 | |
- | echo " | + | dnsutils |
- | service ntp stop | + | whois |
- | ntpdate -s 0.ca.pool.ntp.org | + | fping |
- | service ntp start | + | git |
+ | tmux | ||
+ | mksh | ||
+ | zsh | ||
</ | </ | ||
- | ====== Service management under systemd ====== | ||
- | * Add service to systemd init process: '' | + | ==== Services ==== |
- | * List all services: '' | + | |
- | ====== Disable WiFi completely ====== | + | Service modification |
- | + | ||
- | Blacklist the driver by creating a file in ''/ | + | |
< | < | ||
- | blacklist brcmfmac | + | systemctl disable apt-daily-upgrade.timer |
- | blacklist brcmutil | + | systemctl disable apt-daily.timer |
</ | </ | ||
+ | |||
+ | ===== See also ===== | ||
+ | |||
+ | * [[quay: | ||
+ | * [[quay: | ||
+ | * [[quay: |
pi/raspbian.1589824946.txt.gz · Last modified: 2020-05-18 14:02 by gabriel