RousselTMLEARNING

Article · Linux administration: from discovery to expertise

Linux best practices

1. Access and accounts #

Knowing who does what.

Rules #

  • Named accounts, never direct root login or shared accounts.
  • SSH key-based authentication only, keys protected by a passphrase, bastion for access from the Internet.
  • sudo limited to the necessary commands, edited with visudo in /etc/sudoers.d/.
  • Service accounts without a shell, one per application.
  • Quarterly review of accounts, groups and authorized_keys.

2. System and services #

A predictable server.

Rules #

  • Distribution with long-term support, minimal installation.
  • Automatic security fixes; scheduled reboots when /var/run/reboot-required exists.
  • Services managed by systemd, with Restart=on-failure and sandboxing options.
  • Never modify units shipped by packages: systemctl edit.
  • systemd timers rather than cron for logging and catch-up.
  • Synchronized time (timedatectl, chrony): essential for correlating logs.

3. Storage, network and security #

Avoidable sources of incidents.

Rules #

  • LVM with free space in the VG; UUID and nofail in fstab; mount -a before any reboot.
  • Separate data (/var/lib, /srv) from the system so that filling up does not block the OS.
  • Default-deny firewall, only the necessary ports open, and only to the necessary sources.
  • Internal services listening on 127.0.0.1 or on the private network.
  • SELinux or AppArmor in enforcing mode.
  • fail2ban on exposed services, centralized authentication logs.

4. Operations #

Lasting.

Rules #

  • 3-2-1 backups, encrypted, with regular restore tests.
  • Monitoring of disks, memory, services, backups and certificates, with actionable alerts.
  • All configuration described in Git and applied by Ansible: the server must be rebuildable.
  • Scripts with set -euo pipefail, checked by ShellCheck.
  • Every intervention traced (ticket, commands), with a rollback plan.

Reference diagram and quick check #

Checklist.

Checklist #

Reference Linux server
Controlled access, filtered network, backups, monitoring and configuration as code.
cat /etc/os-release ; uname -r ; uptime
sudo apt list --upgradable 2>/dev/null | wc -l ; ls /var/run/reboot-required 2>/dev/null
sudo sshd -T | grep -E 'permitrootlogin|passwordauthentication'
sudo ufw status verbose || sudo firewall-cmd --list-all
ss -tlnp
systemctl --failed
df -h ; df -i ; free -h
sudo journalctl -p err -b --no-pager | tail
getent group sudo ; sudo ls /etc/sudoers.d
systemctl list-timers | grep -i backup ; restic snapshots --latest 1
timedatectl | grep synchronized
getenforce 2>/dev/null || sudo aa-status | head -3

📄 Linux administration best practices →

My progress

  • ⏱ Estimated time : ≈ 6 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Packages, systemd services, logs and scheduled tasks

Install and update software with apt and dnf, manage services with systemctl, write a systemd uni...

Bash scripts for administrators: writing robust scripts

Automate Linux administration with Bash: variables and quoting, conditions, loops, functions, exi...

Windows updates and security: WSUS, Defender, BitLocker, LAPS and hardening

Maintain and secure a Windows estate: update strategy (Windows Update, WSUS, Azure Update Manager...

Windows administration best practices

The production checklist for Windows and Windows Server: installation, identity and Active Direct...

Windows networking: IP, DNS, DHCP, firewall and remote access

Configure and troubleshoot Windows networking with PowerShell, deploy a DHCP server, master Windo...

eBPF explained: programs in the Linux kernel to observe without instrumenting

What eBPF is, how a program is verified and then run in the kernel, hook points (kprobes, uprobes...

Users, groups, NTFS permissions and SMB shares

Manage local accounts and groups, understand UAC, apply NTFS permissions with inheritance, create...

Windows and Windows Server: versions, editions and architecture

Discover the Windows ecosystem for administrators: Windows 11 and Windows Server 2025, editions a...

Installing Zabbix and monitoring your first host

Install Zabbix with Docker Compose (server, PostgreSQL, web interface), install agent 2 on a Linu...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!