Users connecting to a new server get "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED". The server was rebuilt. How do you handle this at scale?
AdvancedScenarioNetworking, SSH and remote access
Answer
Situation read → New host keys; you need a trusted way to distribute them.
What I'd do →
- Confirm the rebuild is real (out-of-band check of the fingerprint:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubon the console). - Remove the stale entry:
ssh-keygen -R host.example.com. - Long term, sign host keys with an SSH CA and have clients trust it:
# client ~/.ssh/known_hosts
@cert-authority *.example.com ssh-ed25519 AAAA...CA
Servers use HostCertificate /etc/ssh/ssh_host_ed25519_key-cert.pub.
Why → With host certificates, rebuilt servers just get a new signed cert and clients never see warnings or need TOFU.
Interview tip → Never tell people to use StrictHostKeyChecking=no; that's exactly how MITM gets through.
More on Networking, SSH and remote access
A key belonging to a departed engineer may be in `authorized_keys` on 300 servers. How do you rotate SSH keys across the fleet?IntermediateYou need to reach a database on a private subnet from your laptop through a bastion. How?BeginnerYour security team wants SSH hardened on all servers. What changes do you make?BeginnerA new server needs a static IP, gateway and DNS on RHEL 9. How do you configure it persistently?BeginnerYou're changing the network config of a remote server over SSH and could lose access. How do you protect yourself?IntermediateA web server should accept HTTP/HTTPS from anywhere but SSH only from the office. Configure the firewall.Beginner