Linux Server / Networking, SSH & Web Services
Validate OpenSSH server configuration before a remote-access change
A syntax or key-path error can prevent the next SSH restart and lock out administrators. Test configuration before touching the running service.
Environment and inputs: Linux server baseline · Ubuntu 24.04 LTS / RHEL 9-style systems. Use the specified distribution, init system and installed tool; service names, privileges and supported options can differ.
Start with this check
Check the computer, command shell and account permissions. Replace example names, file paths, domains and interfaces with approved values. These commands help investigate the problem. Before making changes, check the rules and the effect on running applications.
/usr/sbin/sshd -t
What the results mean
With the required file and host-key access, the test checks configuration and key sanity. No output with a successful exit is normal; it is not a complete authentication test.
Fix the cause and check again
Correct reported errors, preserve an existing authorized session and use the supported reload process. Test a separate permitted login before closing the original session.
Before changing production
Do not disable host-key or authentication protections to regain access, and keep console recovery available.