| |

LFCA 8 ๐Ÿง First Boot and Initial Setup

The first boot after installing Linux is where the system becomes yours. Everything before this was preparation โ€” the disk was written, the bootloader configured, the initial user created. Now the machine is running, and the first hour of use sets the tone for the system’s entire life. This chapter covers what happens on the first boot, what to check, what to configure immediately, and what to leave for later. The LFCA exam treats this as a distinct topic because a sysadmin’s first task on any new system is the same: verify it’s working, secure it, and make it usable.

Key point: The first boot is about verification and baseline configuration. Confirm the system booted correctly, then do the minimum to make it safe and usable โ€” update, create users, configure the network, enable the firewall, set time and locale. Everything else can wait. Get these wrong and you’re either insecure or fighting configuration for weeks.


What happens on first boot

The system runs through a specific sequence before you can log in.

Boot sequence:

  1. Firmware (BIOS/UEFI) runs POST โ€” checks hardware
  2. Bootloader (GRUB) loads the kernel and initramfs
  3. Kernel initializes hardware, mounts the root filesystem
  4. Init system (systemd) starts services
  5. Display manager (Desktop) or getty (Server) presents a login
  6. Login โ€” user authenticates

On first boot specifically:

  • Desktop: A first-run wizard may appear โ€” theme, online accounts, privacy, Livepatch. These are optional. Skip or configure as you like.
  • Server: A login prompt appears on the console. Log in with the user created during install.
  • Cloud: SSH is the way in. The instance has an IP; you connect with your private key.
  • Container: There’s no “first boot” โ€” the container starts, runs its entrypoint, and stops.

What you’ll see:

PlatformFirst-login experience
Ubuntu DesktopGUI login screen โ†’ desktop โ†’ first-run wizard
Ubuntu ServerTTY login prompt โ†’ shell
Cloud VMSSH from another machine
ContainerIts entrypoint runs; no interactive login unless specified

What to look for:

  • Did it boot cleanly?
  • Did the network come up?
  • Can you log in?
  • Does the display work (Desktop)?
  • Any errors during boot?

Checking boot health:

# On the running system
systemctl --failed
dmesg | tail -30
journalctl -b -p err

If services failed, systemctl --failed lists them. Boot errors show in dmesg and journalctl.

Why the first boot matters: It’s the first chance to verify the install worked. Missing drivers, failed services, or misconfigured hardware all show up immediately. Catching problems here โ€” while the system is fresh โ€” is easier than discovering them weeks later.


Logging in for the first time

Login depends on the install type.

Desktop:

The display manager (usually GDM) shows a login screen. Enter the username and password from install. On first login, a wizard may appear:

  • Ubuntu Pro / Livepatch โ€” optional kernel patching service
  • Online accounts โ€” Google, Microsoft, etc.
  • Privacy settings โ€” error reporting, location services
  • App suggestions โ€” optional

You can skip most of these. The desktop is usable after login regardless.

Server:

The console shows a login prompt. Log in with the credentials created during install. You’re dropped into a shell.

Ubuntu 24.04 LTS myserver tty1

myserver login: alice
Password:
Welcome to Ubuntu 24.04 LTS ...
alice@myserver:~$

Cloud:

Connect via SSH with the key pair you created.

ssh -i ~/.ssh/mykey.pem ubuntu@1.2.3.4

The default user varies by AMI:

ProviderDefault user
AWS Ubuntuubuntu
AWS Amazon Linuxec2-user
AWS Debianadmin
AzureUser-defined
GCPUser-defined

Container:

Containers don’t have a login โ€” you exec into a running container.

docker run -it ubuntu:24.04 bash
docker exec -it <container> bash

What to verify immediately:

  • Hostname is correct
  • Network works
  • You can run sudo
  • Kernel version matches expectations

If login fails:

  • Wrong password โ€” check Caps Lock, try again
  • Account locked โ€” rare on fresh installs; reset via recovery mode
  • Display not starting (Desktop) โ€” switch to TTY with Ctrl+Alt+F3
  • SSH key rejected โ€” check permissions on the private key (must be 600)

Why first login is different from later logins: Install created the account and set up the login mechanism. First login runs first-run wizards, applies initial user config, and generates home directory contents. After that, logins are just authentication.


Verifying the system

Before configuring anything, confirm the install was successful.

Check the distro and version:

lsb_release -a
# Distributor ID: Ubuntu
# Description:    Ubuntu 24.04 LTS
# Release:        24.04
# Codename:       noble

cat /etc/os-release
# NAME="Ubuntu"
# VERSION="24.04 LTS"
# ...

Check the kernel:

uname -r
# 6.8.0-45-generic

uname -a
# full system information

Check the hostname:

hostnamectl
# Static hostname: myserver
# Operating System: Ubuntu 24.04 LTS
# Kernel: Linux 6.8.0-45-generic
# ...

Check the network:

ip addr
# shows interfaces and addresses

ip route
# shows default gateway

ping -c 3 8.8.8.8
# tests connectivity

ping -c 3 ubuntu.com
# tests DNS + connectivity

Check disk usage:

df -h
# shows mounted filesystems and usage

lsblk
# shows block devices

Check for failed services:

systemctl --failed
# returns units that failed to start

systemctl status <service>
# check a specific service

Check the boot log:

journalctl -b
# full log for the current boot

journalctl -b -p err
# errors only

Check CPU and memory:

lscpu
free -h

Why verification matters: Assumptions cause problems. A system that “looks fine” might have a failed service, misconfigured network, or missing driver. Running these commands takes seconds and catches issues early. It’s also what the exam expects: “How would you verify X?” starts with these checks.

Why this is the first task after login: Verification is the baseline. Before you configure anything, you need to know the system is in the expected state. A failed install, a driver issue, or a wrong hostname should be caught now โ€” before you build on top of it.


Setting the hostname

The hostname identifies the machine on the network. It’s set during install but can be changed.

Check the current hostname:

hostname
hostnamectl

Set a new hostname:

sudo hostnamectl set-hostname myserver

The change is immediate and persists across reboots.

Verify:

hostnamectl
# Static hostname: myserver

Update /etc/hosts (optional but clean):

127.0.0.1    localhost
127.0.1.1    myserver

The 127.0.1.1 entry lets the system resolve its own hostname.

Naming conventions:

  • Lowercase letters, numbers, hyphens
  • No spaces or underscores
  • FQDN (e.g., web01.example.com) for domains
  • Descriptive names (web01, db01) help at scale

Why hostname matters: It appears in logs, shell prompts, SSH connections, and monitoring. A good hostname makes systems identifiable. Changing it after installing services is harder โ€” so set it early.

Why 127.0.1.1 is special: Some applications resolve the hostname via /etc/hosts. The 127.0.1.1 entry ensures the hostname resolves to the machine itself, which many services expect. It’s a small detail that prevents odd errors.


Configuring time zone and locale

Time zone and locale affect timestamps, logs, and formatting.

Check current settings:

timedatectl
# Local time: ...
# Time zone: ...
# NTP service: active

localectl
# System Locale: LANG=en_US.UTF-8
# Keyboard Layout: us

Set the time zone:

sudo timedatectl set-timezone Europe/Oslo
sudo timedatectl set-timezone America/New_York
sudo timedatectl set-timezone UTC

List available time zones:

timedatectl list-timezones | grep Europe

Enable NTP (usually on by default):

sudo timedatectl set-ntp true

NTP keeps the clock accurate by syncing with time servers.

Set the locale:

sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8

For servers, use UTC:

sudo timedatectl set-timezone UTC

UTC is the standard for servers. Logs across systems match, and there’s no DST jump.

For desktops, use local time:

Set the time zone to your location so clock apps and calendars show correct local time.

Why time zone matters: Timestamps in logs, emails, certificates, and databases depend on the clock. A wrong time zone makes logs confusing and can break TLS or scheduled tasks. Servers should use UTC; desktops use local time.

Why UTC for servers: Servers talk to each other, log centrally, and often run scheduled jobs. UTC makes all timestamps comparable. Local time on a server means DST changes twice a year and confusion when correlating logs across regions.


Creating users and managing sudo

The install creates one user with sudo access. Additional users may be needed.

The install user:

On Ubuntu, the first user is added to the sudo group automatically.

groups
# alice adm cdrom sudo dip plugdev ...

Create a new user:

sudo adduser bob
# prompts for password and info

adduser is the friendly command. It creates the home directory, sets up defaults, and prompts for a password. (useradd is the low-level command โ€” avoid it unless you need precise control.)

Add to sudo group:

sudo usermod -aG sudo bob

The -aG means “append to group.” Without -a, usermod -G replaces the user’s groups โ€” a common mistake.

Verify:

groups bob
# bob : bob sudo

Set or change a password:

sudo passwd bob

Delete a user:

sudo deluser bob
# keep home dir
sudo deluser --remove-home bob
# remove home dir

Sudo configuration:

The sudoers file is /etc/sudoers. Never edit it with a normal editor โ€” a syntax error locks you out of sudo.

Use visudo:

sudo visudo

Common sudo patterns:

# Full sudo
alice ALL=(ALL:ALL) ALL

# No password
bob ALL=(ALL) NOPASSWD: ALL

# Specific commands only
carol ALL=(ALL) /usr/bin/systemctl restart nginx

Why sudo matters: Working as root is dangerous. sudo gives temporary elevated privileges for specific commands, logging who did what. Every user with admin needs should use their own account with sudo, not root directly.

Why usermod -aG and not usermod -G: The -a flag appends. Without it, -G replaces all supplementary groups โ€” removing the user from others. Always use -aG to add a group.


Configuring the network

Most installs configure the network automatically via DHCP. Verify and adjust if needed.

Check the network:

ip addr
# interfaces and IPs

ip route
# routing table

cat /etc/resolv.conf
# DNS servers

Ubuntu 18.04+ uses Netplan:

ls /etc/netplan/
# 00-installer-config.yaml

cat /etc/netplan/00-installer-config.yaml

Typical DHCP config:

network:
  version: 2
  ethernets:
    enp3s0:
      dhcp4: true

Static IP config:

network:
  version: 2
  ethernets:
    enp3s0:
      addresses:
        - 192.168.1.100/24
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]

Apply changes:

sudo netplan apply

Wi-Fi on Desktop: Usually configured via the GUI. On Server, netplan handles it too, or nmcli if NetworkManager is installed.

Testing:

ping -c 3 8.8.8.8        # connectivity
ping -c 3 ubuntu.com     # DNS
curl https://ubuntu.com  # HTTP

Why network config matters: Servers need stable, predictable addresses. Static IPs for servers; DHCP for clients. Getting this wrong means the machine can’t be reached โ€” a problem when you’re managing it remotely.

Why Netplan: Ubuntu introduced Netplan to unify network configuration across backends (NetworkManager, systemd-networkd). The YAML file describes the desired state; Netplan translates it to the backend. Simple, declarative, and consistent.


Enabling the firewall

A fresh install has no firewall active by default. Enable one before connecting to networks.

UFW โ€” Uncomplicated Firewall:

sudo ufw status
# Status: inactive

sudo ufw default deny incoming
sudo ufw default allow outgoing

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

sudo ufw enable

What this does:

  • Denies all incoming by default
  • Allows all outgoing by default
  • Opens specific ports (SSH, HTTP, HTTPS)
  • Enables the firewall

Verify:

sudo ufw status verbose
# Status: active
# Default: deny (incoming), allow (outgoing)
# To                         Action      From
# --                         ------      ----
# OpenSSH                    ALLOW       Anywhere
# 80/tcp                     ALLOW       Anywhere
# 443/tcp                    ALLOW       Anywhere

Basic commands:

CommandPurpose
ufw statusShow status
ufw enableTurn on
ufw disableTurn off
ufw allow PORTOpen a port
ufw deny PORTClose a port
ufw delete RULERemove a rule
ufw resetReset all rules

Alternative โ€” firewalld on Red Hat family:

sudo systemctl enable --now firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

Why firewall matters: Any open port is an attack surface. A default-deny policy blocks everything except what you explicitly allow. On servers exposed to the internet, the firewall is the first line of defense โ€” before user authentication, before application-level checks.

Why UFW is the Ubuntu default: UFW is a friendly wrapper around iptables (and nftables on modern systems). It provides a simple syntax for common rules and integrates with the installer. Advanced users can still use iptables directly; UFW handles 90% of cases.


Updating the system

Fresh installs ship with whatever was on the ISO. Update before doing anything else.

Debian/Ubuntu:

sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y   # handles dependency changes

Red Hat family:

sudo dnf upgrade --refresh -y

SUSE:

sudo zypper refresh
sudo zypper update -y

Arch:

sudo pacman -Syu

Why this is urgent: Security patches are released continuously. An ISO from a few months ago has known vulnerabilities. The first apt upgrade may pull hundreds of packages.

Automatic updates (optional):

For servers, enable unattended upgrades:

sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

This configures automatic security updates. For desktop systems, the GUI usually handles this.

Reboot if needed:

# Check if reboot is required
[ -f /var/run/reboot-required ] && echo "reboot needed"

sudo reboot

Kernel updates require a reboot to take effect.

Verify the update:

apt list --upgradable
# should show few or none

Why update first: Every task after this โ€” installing packages, configuring services, joining a domain โ€” assumes an up-to-date system. Updates also refresh the package cache, which is needed to install anything. Skipping this leads to version mismatches and security gaps.

Why full-upgrade vs upgrade: apt upgrade upgrades packages without removing any. apt full-upgrade (or dist-upgrade in older versions) can remove packages to resolve dependencies โ€” needed when major updates change structure. On fresh installs, either works; full-upgrade is safer after major changes.


Installing essential tools

A fresh minimal install lacks tools you’ll want daily.

Common installs:

sudo apt install -y \
  curl \
  wget \
  git \
  vim \
  htop \
  tree \
  unzip \
  build-essential \
  net-tools

What each does:

ToolPurpose
curlHTTP client
wgetFile downloader
gitVersion control
vimText editor
htopProcess viewer
treeDirectory tree
unzipZIP extraction
build-essentialCompilers and build tools
net-toolsLegacy networking (ifconfig)

On Desktop: Most are pre-installed. Add build-essential, vim, and a few others.

On Server: Many are missing. Install them.

Shell preferences:

  • bash โ€” the default, pre-installed
  • zsh โ€” popular replacement
  • fish โ€” friendly, less POSIX
sudo apt install -y zsh
chsh -s $(which zsh)

For servers, keep it minimal: Install only what you need. Every package is a potential vulnerability.

Why these tools: They’re the baseline for real work. curl for APIs, git for code, vim for editing configs, htop for monitoring. Minimal installs drop them to save space โ€” you add them back during setup.

Why build-essential matters on servers: Many packages, Python modules, and tools compile from source. Without a compiler and basic build tools, you can’t install them. build-essential is the standard package for this on Debian/Ubuntu.


A full example

A complete first-boot setup session.

# ============================================
# PART 1: LOG IN AND VERIFY
# ============================================

# (Login prompt)
# myserver login: alice
# Password: ****

# Check what we're running
lsb_release -a
# [ Distributor ID: Ubuntu ]
# [ Description:    Ubuntu 24.04 LTS ]
# [ Release:        24.04 ]
# [ Codename:       noble ]

uname -r
# [ 6.8.0-45-generic ]

hostnamectl
# [ Static hostname: myserver ]
# [ ... ]

# Check for failed services
systemctl --failed
# [ 0 loaded units listed. ]

# ============================================
# PART 2: SET HOSTNAME AND TIME
# ============================================

sudo hostnamectl set-hostname web01

sudo timedatectl set-timezone UTC
sudo timedatectl set-ntp true

timedatectl
# [ Local time: ... UTC ]
# [ Time zone: UTC (UTC, +0000) ]
# [ NTP service: active ]

# ============================================
# PART 3: CREATE ADDITIONAL USERS
# ============================================

# The install user (alice) already has sudo
groups alice
# [ alice : alice adm cdrom sudo dip plugdev ... ]

# Add a second user
sudo adduser bob
# [ prompts for password and info ]

# Grant sudo
sudo usermod -aG sudo bob

# Verify
groups bob
# [ bob : bob sudo ]

# ============================================
# PART 4: CONFIGURE NETWORK
# ============================================

ip addr
# [ enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... ]
# [     inet 192.168.1.50/24 ... ]

ip route
# [ default via 192.168.1.1 dev enp3s0 ]

ping -c 3 ubuntu.com
# [ 3 packets transmitted, 3 received ]

# ============================================
# PART 5: ENABLE FIREWALL
# ============================================

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable

sudo ufw status verbose
# [ Status: active ]
# [ Default: deny (incoming), allow (outgoing) ]
# [ To        Action      From ]
# [ --        ------      ---- ]
# [ OpenSSH   ALLOW       Anywhere ]

# ============================================
# PART 6: UPDATE THE SYSTEM
# ============================================

sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y

# Check if reboot is needed
[ -f /var/run/reboot-required ] && echo "reboot needed"

# ============================================
# PART 7: INSTALL ESSENTIAL TOOLS
# ============================================

sudo apt install -y \
  curl \
  wget \
  git \
  vim \
  htop \
  tree \
  unzip \
  build-essential

# ============================================
# PART 8: ENABLE SSH (if not already)
# ============================================

sudo systemctl status ssh
# [ active (running) ]

# If not running:
# sudo systemctl enable --now ssh

# ============================================
# PART 9: AUTOMATIC SECURITY UPDATES
# ============================================

sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

# ============================================
# PART 10: FINAL VERIFICATION
# ============================================

echo "=== System ==="
hostnamectl | head -5

echo "=== Network ==="
ip -br addr

echo "=== Firewall ==="
sudo ufw status | head -3

echo "=== Updates ==="
apt list --upgradable 2>/dev/null | head -5

echo "=== Services ==="
systemctl --failed

Each part corresponds to a concept: verify, set hostname and time, manage users, configure network, enable firewall, update, install tools, enable SSH, set up automatic updates, verify.

Why this shape: It’s a real first-boot workflow. In 15โ€“20 minutes, you go from a fresh install to a baseline-configured system โ€” verified, secure, updated, and usable. That’s the goal of the entire chapter.


Complete Example Session

# ============================================
# PART 1: POST-INSTALL VERIFICATION
# ============================================

lsb_release -a | head -4
# [ Distributor ID: Ubuntu ]
# [ Description:    Ubuntu 24.04 LTS ]
# [ Release:        24.04 ]
# [ Codename:       noble ]

uname -r
# [ 6.8.0-45-generic ]

hostnamectl | head -6
# [ Static hostname: myserver ]
# [ ... ]

systemctl --failed
# [ 0 loaded units listed. ]

journalctl -b -p err --no-pager | tail -5
# [ (no errors) ]

# ============================================
# PART 2: HOSTNAME
# ============================================

sudo hostnamectl set-hostname web01
hostname
# [ web01 ]

# ============================================
# PART 3: TIME AND LOCALE
# ============================================

sudo timedatectl set-timezone UTC
sudo timedatectl set-ntp true

timedatectl
# [ Local time: ... UTC ]
# [ Time zone: UTC (UTC, +0000) ]
# [ System clock synchronized: yes ]
# [ NTP service: active ]

localectl
# [ System Locale: LANG=en_US.UTF-8 ]
# [ VC Keymap: us ]

# ============================================
# PART 4: USERS
# ============================================

sudo adduser bob
# [ Adding user `bob' ... ]

sudo usermod -aG sudo bob
groups bob
# [ bob : bob sudo ]

# ============================================
# PART 5: NETWORK
# ============================================

ip -br addr
# [ lo    UNKNOWN  127.0.0.1/8 ::1/128 ]
# [ enp3s0 UP       192.168.1.50/24 ]

ip route | head -3
# [ default via 192.168.1.1 dev enp3s0 ]

cat /etc/resolv.conf | grep nameserver
# [ nameserver 127.0.0.53 ]

ping -c 2 1.1.1.1
# [ 2 packets transmitted, 2 received ]

ping -c 2 ubuntu.com
# [ 2 packets transmitted, 2 received ]

# ============================================
# PART 6: FIREWALL
# ============================================

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable
# [ Firewall is active and enabled on system startup ]

sudo ufw status
# [ Status: active ]
# [ To        Action      From ]
# [ --        ------      ---- ]
# [ OpenSSH   ALLOW       Anywhere ]

# ============================================
# PART 7: UPDATE
# ============================================

sudo apt update
# [ Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease ]
# [ ... ]

sudo apt upgrade -y
# [ ... 47 upgraded, 0 newly installed ]

sudo apt full-upgrade -y

# ============================================
# PART 8: ESSENTIAL TOOLS
# ============================================

sudo apt install -y curl wget git vim htop tree unzip build-essential
# [ ... Setting up ... ]

which curl git vim htop
# [ /usr/bin/curl ]
# [ /usr/bin/git ]
# [ /usr/bin/vim ]
# [ /usr/bin/htop ]

# ============================================
# PART 9: SSH
# ============================================

sudo systemctl status ssh | head -4
# [ โ— ssh.service - OpenBSD Secure Shell server ]
# [    Loaded: loaded ]
# [    Active: active (running) ]

# ============================================
# PART 10: AUTOMATIC UPDATES
# ============================================

sudo apt install -y unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades
# [ Automatic updates: enabled ]

# ============================================
# PART 11: FINAL CHECK
# ============================================

echo "=== Hostname ==="
hostname

echo "=== Network ==="
ip -br addr | grep -v lo

echo "=== Firewall ==="
sudo ufw status | grep Status

echo "=== Updates ==="
apt list --upgradable 2>/dev/null | wc -l

echo "=== Failed services ==="
systemctl --failed --no-legend

The session covers every first-boot task โ€” verification, hostname, time, users, network, firewall, updates, tools, SSH, auto-updates, final check.

Why this exercise is comprehensive: It mirrors the workflow a sysadmin runs on every new system. In 15โ€“20 minutes, the system is verified, named, secured, updated, and usable. The exam tests these concepts โ€” knowing the order and the commands is the practical skill.


Quick Reference

First-Boot Sequence

StageWhat happens
FirmwarePOST, hardware check
BootloaderLoads kernel + initramfs
KernelInitializes hardware
systemdStarts services
LoginAuth prompt
First loginWizard or shell

Verification Commands

CheckCommand
Distrolsb_release -a
Kerneluname -r
Hostnamehostnamectl
Networkip addr / ip route
Failed servicessystemctl --failed
Boot errorsjournalctl -b -p err
Diskdf -h / lsblk
CPUlscpu
Memoryfree -h

Hostname

CommandPurpose
hostnameShow current hostname
hostnamectlShow detailed info
sudo hostnamectl set-hostname NAMEChange it

Time and Locale

CommandPurpose
timedatectlShow time settings
sudo timedatectl set-timezone ZONESet time zone
sudo timedatectl set-ntp trueEnable NTP
localectlShow locale and keyboard
sudo update-locale LANG=...Set locale

Time Zone Choices

SystemRecommended
ServerUTC
DesktopLocal time
CloudUTC
Distributed systemUTC

User Commands

CommandPurpose
adduser NAMECreate user (interactive)
usermod -aG sudo NAMEGrant sudo
passwd NAMESet password
deluser NAMEDelete user
deluser --remove-home NAMEDelete with home
groups NAMEShow groups
visudoEdit sudoers safely

Network Configuration

CommandPurpose
ip addrShow interfaces
ip routeShow routes
cat /etc/resolv.confDNS
ping HOSTConnectivity
netplan applyApply config
nmcliNetworkManager CLI

Firewall (UFW)

CommandPurpose
ufw statusShow rules
ufw enableEnable
ufw disableDisable
ufw allow PORTOpen port
ufw allow OpenSSHOpen SSH
ufw deny PORTBlock port
ufw delete RULERemove rule
ufw resetReset all

Update Commands by Distro

DistroUpdate
Debian/Ubuntusudo apt update && sudo apt upgrade
Red Hatsudo dnf upgrade
SUSEsudo zypper update
Archsudo pacman -Syu
Alpinesudo apk update && apk upgrade

Essential Tools

ToolPurpose
curlHTTP client
wgetDownload
gitVersion control
vimText editor
htopProcess viewer
treeDirectory tree
unzipZIP extraction
build-essentialCompilers
net-toolsLegacy network

SSH

CommandPurpose
systemctl status sshCheck status
systemctl enable --now sshEnable
ufw allow OpenSSHOpen firewall
ssh -i KEY user@hostConnect

Automatic Updates

TaskCommand
Installsudo apt install unattended-upgrades
Configuresudo dpkg-reconfigure --priority=low unattended-upgrades
Check logscat /var/log/unattended-upgrades/*.log

Cloud-Specific

TaskNote
Default userubuntu, ec2-user, admin
SSH keyRequired, permissions 600
Cloud-initRuns on first boot
MetadataInstance info via 169.254.169.254

First-Boot Checklist

StepAction
1Log in
2Verify system (lsb_release, uname)
3Check failed services
4Set hostname
5Set time zone and NTP
6Create users
7Configure network
8Enable firewall
9Update packages
10Install essential tools
11Enable SSH
12Enable unattended upgrades
13Verify final state

Common Issues

IssueCauseFix
Can’t log inWrong passwordReset via recovery
No networkWrong interfaceCheck ip addr
No DNSResolv configCheck /etc/resolv.conf
Locked out of sudoBad sudoersUse recovery mode
Firewall blocks SSHRule missingufw allow OpenSSH
Disk fullSmall installdf -h, resize
Service failedMisconfigjournalctl -u SERVICE

Best Practices

โœ… Do This:

# Verify the system first
lsb_release -a
uname -r
systemctl --failed                                    # โœ…

# Set the hostname early
sudo hostnamectl set-hostname myserver                # โœ…

# Use UTC on servers
sudo timedatectl set-timezone UTC                     # โœ…

# Enable NTP
sudo timedatectl set-ntp true                         # โœ…

# Create users (don't work as root)
sudo adduser alice
sudo usermod -aG sudo alice                           # โœ…

# Use visudo to edit sudoers
sudo visudo                                           # โœ…

# Enable the firewall before connecting
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow OpenSSH
sudo ufw enable                                       # โœ…

# Update immediately
sudo apt update && sudo apt upgrade -y                # โœ…

# Install essential tools
sudo apt install -y curl git vim htop                 # โœ…

# Enable unattended upgrades on servers
sudo apt install unattended-upgrades                  # โœ…

# Verify SSH works before disconnecting
ssh user@host                                         # โœ…

# Document what you set up
# Keep notes for the next admin                       # โœ…

โŒ Don’t Do This:

# Don't skip updates
# Vulnerabilities remain unpatched                    # โŒ

# Don't use `usermod -G` without `-a`
sudo usermod -G sudo bob  # replaces other groups     # โŒ

# Don't edit sudoers directly
sudo nano /etc/sudoers  # use visudo instead          # โŒ

# Don't work as root
sudo su -  # not needed; use sudo per command         # โš ๏ธ

# Don't disable the firewall
sudo ufw disable  # unless debugging                  # โš ๏ธ

# Don't use a wrong time zone
# Set explicitly, verify with timedatectl             # โŒ

# Don't leave hostname as default
# `ubuntu`, `localhost` are ambiguous                  # โŒ

# Don't skip setting up SSH before closing the console
# You may lose remote access                          # โŒ

# Don't forget to enable services on boot
sudo systemctl enable --now ssh                       # โœ…

# Don't skip verification after changes
# Always check the result                            # โœ…

Common Pitfalls

PitfallProblemSolution
Wrong time zoneMisleading logsSet explicitly
Skipping updatesVulnerabilitiesapt upgrade first
usermod -G without -aRemoves other groupsUse -aG
Editing sudoers directlyCan lock outUse visudo
Firewall offExposedEnable before network
Wrong hostnameAmbiguity at scaleSet early
Not installing toolsMissing utilitiesInstall baseline
Not enabling SSHCan’t reconnectsystemctl enable ssh
No auto-updates on serverSecurity driftunattended-upgrades
Root as primary userAudit problemsUse sudo
Losing key fileLocked outBack up SSH keys
Not verifying networkSilent failuresping, curl
Locale mismatchCharacter issuesupdate-locale
Forgetting NTPClock drifttimedatectl set-ntp true

Real-World Examples

1. Verify distro

lsb_release -a

2. Verify kernel

uname -r

3. Check failed services

systemctl --failed

4. Set hostname

sudo hostnamectl set-hostname web01

5. Set time zone

sudo timedatectl set-timezone UTC

6. Enable NTP

sudo timedatectl set-ntp true

7. Create user

sudo adduser bob

8. Grant sudo

sudo usermod -aG sudo bob

9. Check network

ip -br addr

10. Check route

ip route

11. Test connectivity

ping -c 3 1.1.1.1

12. Test DNS

ping -c 3 ubuntu.com

13. Enable firewall

sudo ufw enable

14. Allow SSH

sudo ufw allow OpenSSH

15. Update

sudo apt update && sudo apt upgrade -y

16. Install tools

sudo apt install -y curl git vim htop

17. Enable SSH

sudo systemctl enable --now ssh

18. Auto-updates

sudo apt install unattended-upgrades

19. Check disk

df -h

20. Reboot if needed

[ -f /var/run/reboot-required ] && sudo reboot

Visual: First Boot Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Power on                                    โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Firmware (BIOS/UEFI)                        โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Bootloader (GRUB)                           โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Kernel                                      โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  systemd                                     โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Login prompt                                โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  User shell                                  โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: First-Boot Tasks

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  1. Log in                                   โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  2. Verify system                            โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  3. Set hostname                             โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  4. Set time zone + NTP                      โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  5. Create users                             โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  6. Configure network                        โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  7. Enable firewall                          โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  8. Update system                            โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  9. Install tools                            โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚ 10. Enable SSH + auto-updates                โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Verification Commands

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  What am I running?                          โ”‚
โ”‚  โ”€โ”€ lsb_release -a                           โ”‚
โ”‚  โ”€โ”€ uname -r                                 โ”‚
โ”‚  โ”€โ”€ hostnamectl                              โ”‚
โ”‚                                              โ”‚
โ”‚  Is it healthy?                              โ”‚
โ”‚  โ”€โ”€ systemctl --failed                       โ”‚
โ”‚  โ”€โ”€ journalctl -b -p err                     โ”‚
โ”‚                                              โ”‚
โ”‚  Is it connected?                            โ”‚
โ”‚  โ”€โ”€ ip addr                                  โ”‚
โ”‚  โ”€โ”€ ping                                      โ”‚
โ”‚                                              โ”‚
โ”‚  Is it up to date?                           โ”‚
โ”‚  โ”€โ”€ apt list --upgradable                    โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Time Zone Choice

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Server                                      โ”‚
โ”‚  โ”€โ”€ UTC                                      โ”‚
โ”‚  โ”€โ”€ Consistent across regions                โ”‚
โ”‚  โ”€โ”€ No DST surprises                         โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Desktop                                     โ”‚
โ”‚  โ”€โ”€ Local time zone                          โ”‚
โ”‚  โ”€โ”€ Clock apps show correct local time       โ”‚
โ”‚  โ”€โ”€ User-facing                            โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Distributed system                          โ”‚
โ”‚  โ”€โ”€ UTC everywhere                           โ”‚
โ”‚  โ”€โ”€ Logs correlate                           โ”‚
โ”‚  โ”€โ”€ Analytics work                           โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Firewall Before Network

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โŒ Wrong order                              โ”‚
โ”‚                                              โ”‚
โ”‚  Connect to internet โ”€โ”€โ–บ enable firewall     โ”‚
โ”‚                                              โ”‚
โ”‚  Exposed during window                       โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  โœ… Right order                              โ”‚
โ”‚                                              โ”‚
โ”‚  Enable firewall โ”€โ”€โ–บ connect to internet     โ”‚
โ”‚                                              โ”‚
โ”‚  Protected from the start                    โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: sudo Group Workflow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Install creates user                        โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Added to `sudo` group automatically         โ”‚
โ”‚                                              โ”‚
โ”‚  Additional users:                           โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  adduser bob                                 โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  usermod -aG sudo bob                        โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Bob can now use sudo                        โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Update Before Install

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  1. apt update                               โ”‚
โ”‚     โ””โ”€โ”€ refresh package index                โ”‚
โ”‚                                              โ”‚
โ”‚  2. apt upgrade                              โ”‚
โ”‚     โ””โ”€โ”€ install newer versions               โ”‚
โ”‚                                              โ”‚
โ”‚  3. apt full-upgrade                         โ”‚
โ”‚     โ””โ”€โ”€ handle dependency changes            โ”‚
โ”‚                                              โ”‚
โ”‚  4. Install new packages                     โ”‚
โ”‚     โ””โ”€โ”€ now uses current versions            โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Essential Tools

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Networking    โ†’  curl, wget, net-tools      โ”‚
โ”‚  Version ctrl  โ†’  git                        โ”‚
โ”‚  Editor        โ†’  vim, nano                  โ”‚
โ”‚  Monitoring    โ†’  htop, top                  โ”‚
โ”‚  Files         โ†’  tree, unzip                โ”‚
โ”‚  Build         โ†’  build-essential            โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Post-First-Boot System

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Hostname set         โ”€โ”€โ–บ web01              โ”‚
โ”‚  Time zone            โ”€โ”€โ–บ UTC                โ”‚
โ”‚  NTP                  โ”€โ”€โ–บ active             โ”‚
โ”‚  Users                โ”€โ”€โ–บ alice, bob (sudo)  โ”‚
โ”‚  Network              โ”€โ”€โ–บ configured         โ”‚
โ”‚  Firewall             โ”€โ”€โ–บ enabled            โ”‚
โ”‚  Updates              โ”€โ”€โ–บ current            โ”‚
โ”‚  Tools                โ”€โ”€โ–บ installed          โ”‚
โ”‚  SSH                  โ”€โ”€โ–บ enabled            โ”‚
โ”‚  Auto-updates         โ”€โ”€โ–บ configured         โ”‚
โ”‚                                              โ”‚
โ”‚  โ†’ Baseline-configured system                โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Visual: Secure Boot Order

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  1. Boot system                              โ”‚
โ”‚                                              โ”‚
โ”‚  2. Log in as install user                   โ”‚
โ”‚                                              โ”‚
โ”‚  3. Update packages                          โ”‚
โ”‚                                              โ”‚
โ”‚  4. Enable firewall BEFORE network           โ”‚
โ”‚                                              โ”‚
โ”‚  5. Configure network                        โ”‚
โ”‚                                              โ”‚
โ”‚  6. Create users with sudo                   โ”‚
โ”‚                                              โ”‚
โ”‚  7. Enable SSH                               โ”‚
โ”‚                                              โ”‚
โ”‚  8. Install tools                            โ”‚
โ”‚                                              โ”‚
โ”‚  9. Auto-updates                             โ”‚
โ”‚                                              โ”‚
โ”‚  Result: hardened, usable system             โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ConceptMeaning
First bootSystem comes up for the first time
VerificationCheck system is healthy
HostnameMachine identifier
Time zoneUTC for servers, local for desktops
UsersSudo access via group
NetworkDHCP or static via Netplan
FirewallUFW default-deny
UpdatesBefore anything else
Essential toolsCurl, git, vim, htop, etc.
Auto-updatesUnattended-upgrades on servers

Key takeaways:

  • The first boot boots the kernel, starts services, presents a login
  • Desktop, Server, and Cloud have different first-login experiences
  • Verify the system first โ€” distro, kernel, hostname, network, failed services
  • Set the hostname early โ€” it appears in logs, SSH, and monitoring
  • Use UTC on servers, local time on desktops
  • Enable NTP to keep the clock accurate
  • Create users with adduser and grant sudo with usermod -aG sudo
  • Use visudo, never edit /etc/sudoers directly
  • Configure the network with ip addr, ip route, and Netplan
  • Enable the firewall before connecting to networks โ€” ufw default-deny
  • Update the system immediately โ€” security patches come first
  • Install essential tools โ€” curl, git, vim, htop, and build tools
  • Enable SSH before disconnecting remote sessions
  • Set up unattended-upgrades on servers for security patches
  • Verify at the end โ€” everything should be configured and running

Remember: First boot is about getting the system from “installed” to “usable and safe.” Verify it works, name it, secure it, update it, and make it comfortable to use. Everything after this โ€” installing applications, joining domains, deploying services โ€” assumes these basics are done. Do them in the first 15 minutes and the system is ready for anything.


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!