Skip to main content

Bootstrapping a Debian Machine

debian.org downloads debian

Installation

Clean Up the Standard Installation

sudo apt purge debian-faq doc-debian installation-report tasksel
sudo apt --purge autoremove

Install Essentials

sudo apt install bash-completion bind9-dnsutils bzip2 curl ethtool htop iotop screen sudo unzip vim wget

Install Security Enhancements

Enforcing Password QualityEnforcing Password Quality Verifying Installation IntegrityVerifying Installation Integrity

sudo apt install debsums libpam-pwquality libpam-tmpdir

Install Virtual Machine Guest Agent

sudo apt install qemu-guest-agent

Configuration

Grant Password-less Sudo Access

Since sudo is likely not yet available, the following commands must be run as root.

( umask 0337; tee "/etc/sudoers.d/sudo" >/dev/null <<'EOF'
%sudo ALL=(ALL) NOPASSWD: ALL
EOF
)
chmod 0440 "/etc/sudoers.d/sudo"
gpasswd --add [USERNAME] sudo

Set the Machine Hostname

sudo hostnamectl set-hostname [HOSTNAME]
sudo sed -i '/^127.0.1.1/d' "/etc/hosts"
sudo sed -i '1i127.0.1.1\t[HOSTNAME].[DOMAIN] [HOSTNAME]' "/etc/hosts"

Set the Machine Timezone

sudo timedatectl set-timezone [TIMEZONE]
Set the Machine Timezone to UTC
sudo timedatectl set-timezone Etc/UTC

Generate Machine Locales

sudo locale-gen
Generate the Slovak Locale
sudo sed -i 's/^[#[:space:]]*sk_SK\.UTF-8 UTF-8$/sk_SK.UTF-8 UTF-8/' "/etc/locale.gen"
sudo locale-gen
Generate the English Locale
sudo sed -i 's/^[#[:space:]]*en_US\.UTF-8 UTF-8$/en_US.UTF-8 UTF-8/' "/etc/locale.gen"
sudo locale-gen

Tweak the Kernel Tunable Variables

TODO: add kernel variables to /etc/sysctl.conf

Time Synchronization Using NTP

The Chrony_Project chrony/chrony

Debian uses systemd-timesyncd by default, which does not continuously synchronize the clock while the system is running. chrony provides continuous, periodical time synchronization via background daemon.

sudo apt install chrony
sudo systemctl restart chronyd