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

See login attempts

Follow SSH logins and failures on systemd systems.

journalctl -u ssh -f

Limit who can log in

Allow only listed users to connect.

AllowUsers deploy admin

Change the SSH port

Move sshd to another port. Open the new port in the firewall before restarting.

Port 2222

Was this page helpful?