tags: - raspberry pi - setup categories: - informational comments: true
Configuration changes to make on new raspberry pi - raspbian systems.
systemctl disable hciuart.service
systemctl disable bluealsa.service
systemctl disable bluetooth.service
grep disable-bt /boot/overlays/README
Name: disable-bt
Load: dtoverlay=disable-bt
Name: pi3-disable-bt
Info: This overlay has been renamed disable-bt, keeping pi3-disable-bt as an
grep disable-wifi /boot/overlays/README
Name: disable-wifi
Load: dtoverlay=disable-wifi
Name: pi3-disable-wifi
Info: This overlay has been renamed disable-wifi, keeping pi3-disable-wifi as
systemctl disable avahi-daemon.service
systemctl stop avahi-daemon.service
FIXME:
systemctl disable wpa_supplicant
wpa_supplicant
process on rebootsmv /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant /root
Ignore recommends/suggests when installing software
/etc/apt/apt.conf
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Dpkg::Options {
"--force-confdef";
"--force-confold";
}
apt update
apt dist-upgrade
sysctl settings
/etc/sysctl.d/90-vm-disable-oom-killer.conf
# Disable OOM killer
vm.overcommit_memory=2
vm.overcommit_ratio=90
# -1: Allow use of (almost) all events by all users
# >=0: Disallow raw tracepoint access by users without CAP_IOC_LOCK
# >=1: Disallow CPU event access by users without CAP_SYS_ADMIN
# >=2: Disallow kernel profiling by users without CAP_SYS_ADMIN
# >=3: Disallow all event access by users without CAP_SYS_ADMIN
#
# https://lwn.net/Articles/696216/
#
kernel.perf_event_paranoid=3
kernel.core_pattern = /var/core/core_%h_%e_%u_%g_%t_%p
mkdir /var/core
Default profile
/etc/profile.d/login.sh
export EDITOR=vi
set -o vi
export TMOUT=900
readonly TMOUT
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
apt install vim-nox
vim for root
root/.vimrc
syntax on
apt install unattended-upgrades
dpkg-reconfigure unattended-upgrades
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename},label=debian";
"origin=Debian,codename=${distro_codename},label=Debian-Security";
"origin=Raspbian,codename=${distro_codename},label=Raspbian";
"origin=Raspberry Pi Foundation,codename=${distro_codename},label=Raspberry Pi Foundation";
};
Unattended-Upgrade::Package-Blacklist {
};
Unattended-Upgrade::AutoFixInterruptedDpkg "true";
Unattended-Upgrade::MinimalSteps "true";
Unattended-Upgrade::InstallOnShutdown "false";
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Automatic-Reboot "true";
Unattended-Upgrade::Automatic-Reboot-WithUsers "true";
Unattended-Upgrade::Automatic-Reboot-Time "02:00";
systemctl status unattended-upgrades systemctl enable unattended-upgrades
userdel pi
rm -rf /home/pi
Change sudoer to allow users in sudo group to change role without passwords
change in /etc/sudoer
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
passwd root
passwd -d ubuntu
Disable dsa key in sshd and remove dsa keys
comment in /etc/ssh/sshd_config
# HostKey /etc/ssh/ssh_host_dsa_key
rm /etc/ssh/ssh_host_dsa_key*
Disable depreciated setting and disable forwarding
add/change in /etc/ssh/sshd_config
# UsePrivilegeSeparation yes
AllowAgentForwarding yes
AllowTcpForwarding yes
GatewayPorts no
X11Forwarding yes
/usr/sbin/sshd -t
auto eth0
iface eth0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.x
systemctl disable dhcpcd.service
/etc/systemd/timesyncd.conf:NTP=x.x.x.x y.y.y.y
systemctl status systemd-timesyncd.service
systemctl status rng-tools.service
install and enable logcheck? logwatch?
### WARNING ###
...
...
apt install tcpdump lsof
blkid
fdisk /dev/sda
mkfs.ext4 /dev/sda1
PARTUUID=7e60cada-01 /data ext4 defaults,noatime,errors=remount-ro 0 2
mkdir /data
mkdir -p /data/var/cache /data/var/spool
mv /var/log /data/var
ln -sf /data/var/log /var/log
mv /var/cache/apt /data/var/cache/
ln -s /data/var/cache/apt /var/cache/
mv /var/spool/postfix /data/var/spool/
ln -s /data/var/spool/postfix /var/spool/
reboot
disable journal
change to ‘volatile’ and restart
grep Storage /etc/systemd/journald.conf
Storage=volatile
systemctl restart systemd-journald.service