The ssh server and its configuration
sshd is the service you are connected over, which makes changing it uniquely risky. This guide reads the effective configuration - not the file, which is not the same thing - then breaks it deliberately and shows the check that catches the mistake before a restart could act on it.
Networking Guide 27 of 38 Intermediate
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 14 min
OpenSSH 10.2p1 on Ubuntu 26.04, with a drop-in directory that both cloud-init and this lab write to. The unit is ssh on Debian and Ubuntu and sshd on RHEL - a difference that matters when you restart it.
- Firewallufw 0.36.2 enabled but reporting inactive / firewalld active
- Network confignetplan + systemd-networkd / NetworkManager 1.56.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LFCS-A01 | 192.168.0.70 | Ubuntu 26.04 LTS | Primary host - most guides run only here | 2 Core | 4 GB | 50 GB |
| LFCS-C01 | 192.168.0.72 | AlmaLinux 10.2 | The other distribution - dnf, firewalld and NetworkManager | 2 Core | 4 GB | 50 GB |
This guide includes
Use this because sshd is the service you are connected over, which makes changing it unlike changing anything else. This matters because an invalid setting is only discovered when the daemon restarts - and by then you are already locked out.
- reading the configuration actually in force, which is not the file
- catching a syntax error before it could matter
- running the same query on RHEL, and putting the file back
- using the client side, with keys
Before you start
-
The configuration that is actually in force
-
A syntax error, caught before it could matter
-
RHEL's side, and putting the file back
-
The client side