SSH (OpenSSH) 10 cheatsheet
SSH (OpenSSH) 10: Server (sshd)
6 common SSH (OpenSSH) 10 tasks.
Test the server configuration
Check /etc/ssh/sshd_config for errors before restarting. A mistake can lock you out.
sudo sshd -t
Disable password logins
Allow keys only and block root logins. Confirm key login works first, in a second session.
PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
Caution: If key login isn't working, this setting locks you out. Keep a second session open while testing.
Apply sshd changes
Reload the SSH server after editing its configuration. Existing sessions stay open.
sudo systemctl reload sshd
Change the SSH port
Move sshd to another port. Open the new port in the firewall before restarting.
Port 2222